Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Monday, March 26, 2012

Ajax Toolkit issue with web deploy project in Visual Studio 2005

Error 157 Unable to copy file "C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AJAX Control ToolKit\SampleWebSite\Bin\zh-CHT\AjaxControlToolkit.resources.dll" to "C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\TipWebCurrent\TipWeb\Bin\zh-CHT\AjaxControlToolkit.resources.dll". Access to the path 'C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\TipWebCurrent\TipWeb\Bin\zh-CHT\AjaxControlToolkit.resources.dll' is denied. 1 1 TipWeb_deployProject

I am getting the above problem when I try and build my solution,(web deploy project specifically) is it as simple as changing the properties of the read-only access for each folder to false for each of the folders containing the dll's?


Yes, the directory that you are publishing to or at least the bin should have right access until you are done deploying, then make it read only again.


Yep, that was the main issue... Once I changed the permissions it worked like a charm!

:)

Saturday, March 24, 2012

Ajax Tabs OnClientActiveTabChanged error

I have 3 tabs .OnClientActiveTabChanged event I am calling a function which is defined in a separate javascript file.My code works when I have the script code in same file as aspx page. But it throws javascript error when i have the code in a seprate javascript file. "Null is null or not an object" var InslastName = $get(''); var InsFirstName = $get('');The InslastName and InsFirstName are always getting as null when using external script file.I tried to use the ids 'txtInslastName' and 'txtInsFirstName' in the function,but getting error.I have many attributes in my aspx page . So i cant pass ClientID as parameter to the function.Is there any way to get resolve this issue?

Hi Sarathmn,

We cannot use Control.ClientID on a separate js file. Your problem is mainly caused by the ClientID issue. When a TextBox inside a TabPanel, its ClientID looks like this TabContainer1_TabPanel2_TextBox1, so you can find out the real ClientID from the generated HTML code and modify your js functions. Here is the another way which I would prefer.

<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" OnClientActiveTabChanged="tabChanged">

function tabChanged(sender, args){
tabIndex = sender.get_activeTabIndex();
switch(tabIndex)
{
case 1: myfunction('"<%=TextBox1.ClientID%>"');break;
case 2: myfunction('"<%=TextBox2.ClientID%>"');break;
break;
}
}

myfunction is a function inside the separate js file.

I hope this help.

Best regards,

Jonathan


Thanks Jonathan for your reply.

I have a doubt.

Can I assume that the client side id of the controls inside a TabPanel have "TabContainer1_TabPanel2_" pre-fixed with the actual id?


Hi Sarathmn,

Currently, yes. But if you put the Tab control inside another contol, it is hard to say.

I hope this help.

Best regards,

Jonathan

Wednesday, March 21, 2012

Ajax Tab Panel and File Upload

Iam using ajax Tab Container , there i have one File upload , when i use that File Upload without ajax tab container it works fine , but in Ajax Tab Container it gives me an error that "Object reference is not set to instance of object", kindly help

regards

is it inside an update panel ??

the update panel is listed as not working with certain controls.

File upload, and tree view being 2 of the biggies.

IN any case, one solution is available on code project:

http://www.codeproject.com/useritems/simpleajaxupload.asp

if you look around the forums and google, you can read more aboutthe problem if your interested, but the code project solution shouldget you started.

From the online documentation:

http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx

Controls that Are Not Compatible with UpdatePanel Controls

The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside anUpdatePanel control:

TreeView andMenu controls.