Showing posts with label adding. Show all posts
Showing posts with label adding. Show all posts

Monday, March 26, 2012

Probelms with Modal Popup via server in code behind

Hi all

I am having problems while adding the modal popup dynamically to my page on the server side on a (web user control). When I set the "TargetControlId" or the "PopupControlId" like this -

ModalPopupExtender modPop = new ModalPopupExtender();
TextBox tbMsg = new TextBox();
tbMsg.ID = "tbMsg";
tbMsg.Text = "Thanks!";
modPop.ID = "modulePopup";
modPop.TargetControlID = hiddenField.ID; //made this hidden field in the user control
modPop.PopupControlID = tbMsg.ClientID;
modPop.BackgroundCssClass = "modalBackground";
modPop.X = 200;
modPop.Y = 200;

Now what is happening is that the ID's that go to the modal popup javascript (ScriptResource etc) I see that it goes in as the name of the textbox itself "tbmsg" instead of the client ID ? so I see something like document.getElementByID("tbMsg") !!!

What am I supposed to do??

Thanks in advance

Sanchita

hiddenField.ClientID will get the ID which is generated by ASP.net

Problem - Adding AJAX ddls as a reference rather than GAC (.msi) install

I have spent a lot of time reading these forums and realize that this is a very hot question right now. I fall into the plethora of people who's web host does not install the AJAX.msi...

After reading for a while I have come across multiple posts that stated that they have simply added the dll's as a reference and got their site running without even having to touch the GAC. Despite this, people still seem to be having troubles (including me) doing this and there also seems to be a bit of a dispute as to teh disadvantages to this approach (especiall the trust factor).

Can someone, who has successfully added these as a refernce and not via the GAC, do a quick walkthrough for the rest of us? I have added them, but cannot get AJAX controls to function (it complies fine without erros, but they do not "activiate" or anything while I am debugging). If someone could do a detailed walkthrough, I think it will not only help many out, but it will also make AJAX avalible to many many other people.

Finally, if anyone can comment on the disadvantages of this, that would be great as well. Hopefully, we can get this all in one place so that everyone will have a nice reference. Thanks!

Nathan

With each version of Atlas and then the most recent releases of Ajax and the Toolkit I did exactly what you are asking about each time, successfully.

There are only two requirements, other than the actual code in your Ajax enabled pages.

1) Your applications /bin/ folder much contain the correct DLLs.

2) Your applications web.config must contain the correct information about the build versions in your apps /bin/ folder.

The easiest way for me to make the changes each time has been to use the sample Ajax web.config provided to modify my own apps web.config


Thanks for the reply!j

I guess my problem is stemming from the web.config then. i am attempting to customize it to fit my build... I know very little about it. To honest, i am not fluent enough to determine which parts are needed specifically. Can you post the changes you made in order to adapt it to "point" to your bin directory? Thanks!


No problem.

This is a working web.config for each of the current versions:

-------------

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<connectionStrings>
<clear />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=server;Initial Catalog=database;User ID=user;Password=password;" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.net>
<mailSettings>
<smtp>
<network host="localhost" port="25"/>
</smtp>
</mailSettings>
</system.net>
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview"/>
</controls>
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0"/>
</tagMapping>
</pages>
<compilation debug="false">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
<buildProviders>
<add extension="*.asbx" type="Microsoft.Web.Preview.Services.BridgeBuildProvider"/>
</buildProviders>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="GET,HEAD,POST" path="*.asbx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ASBXHandler" verb="GET,HEAD,POST" path="*.asbx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration>
--------------------------


I appreciate the assitance there, but I am still having no luck. I have spoken with a few others who are encoutering the same errors as I am. They stated that this is a trust issue set by my host rather than a configuration issue that I am having...<trust level="Medium"/>

I am at a loss of what else to try other than to hope that my host comes to their senses... Thanks! If you have any other ideas, please let me konw. thanks!


I'd still like to help you overcome this, can you mention the host so some of us might look into this for you?

I've seen reports of some hosts not allowing full trust but still wonder why...

By the way, what happens if you remove the trust level or set it to "full"?


Hey! I really appreciate you will to help me with this! You rock!

Anyway, I host with godaddy.com. What kills me is that their hosting plan is insanely awesome / cheap, but they are lacking in this, :( ... I have called them and asked if they have / were planning to install the AJAX updates. They said that they had no plans to do so.

If I remove the trust level or raise it to full, I get the same error that I was speaking of (I will post it in the next post).

If you would like, I would be more than happy to open up a temp user / pwd on my account and let you tinker with it via ftp, if you would feel comfortable doing so.

Thanks again!


My good ol' error...

Server Error in '/' Application.


Attempt to access the method failed.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.MethodAccessException: Attempt to access the method failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


I don't deal with godaddy at all but suggest you ask them if an Ajax installation might be an option for you if you use their Metropolis addon.

https://www.godaddy.com/gdshop/hosting/shared.asp?ci=260

You might also want to mention to them that many of the Starter Kits they offer may soon include Ajax, which I'm sure they already know.

I can't suggest any ASP.NET host to match those unbelievably low prices but can suggest a very good host with the works,http://www.DiscountASP.net


I have read that if the trust level is not set to full, then the dlls need to be in the GAC,
or AJAX simply won't work.

This is by design,

Yours
Andreas Knudsen

Okay,

I am goign to speak with Godaddy in the morning. hopefully we can work something out. I appreciate all the feedback. I will post my results. Thanks!


I too have this problem with my host, What are the disadvantages of your host running full trust?

Hi,

Any luck with godaddy? I am also using their hosting and having the same problem. So, to solve a problem I am temporary using Atlas AJAX July build. But it is kind of slow. So, I am planning to switch to another hosting company.


I've done the same thing but I get a different kind of error:

Description:Anerror occurred during the processing of a configuration file requiredto service this request. Please review the specific error details belowand modify your configuration file appropriately.

Parser Error Message:Couldnot load file or assembly 'System.Web.Extensions, Version=1.0.61025.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of itsdependencies. The module was expected to contain an assembly manifest.

Source Error:

Line 45: <assemblies>
Line 46:
Line 47: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Line 48: <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 49: <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Can someone help me out pls!! Im dying to see my AJAX site in action!


Your assembly information is correct.

Who is the Host? Are they allowing Full trust? (Application's bin folder)

Have you tried placing the Ajax DLLs in your apps /bin/ folder?
(Look for these in: C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\)

Saturday, March 24, 2012

Problem adding atlas controls to existing web form

I created an atlas web site from the Atlas Template and added some files from another web site, so I tried to add <atlas:ScriptManager...> tag, but VS2005 didn't recognize Atlas (now ASP.Net AJAX) tags.

How can I add Atlas to existing ASP.Net web sites?

i'll need to register the "altas" tag in your web.config file.

I've discovered the problem. Atlas intellisense doesn't work in projects on network shares, so I installed Visual Source Safe and now it recognizes as being run locally.

Problem adding Atlas to an existing site

I have created a test atlas site and successfully used the update panel with some dropdown lists. Now I want to incorporate Atlas into an existing web site. I created a test page in the existing web site and recreated my test page in the existing site. The Atlas components to not seem to work... instead of an ajax update it is doing a full postback.

Here are the things I've checked:

- Atlas dll is included in bin
- Web.config file is updated and matches the test site config exactly
- Test web page is exactly the same as on the test site
- The .asbx extension is registered correctly
- The web site is configured for .Net 2.0

I'm not even sure how to figure out what else is going on here. Any other suggestions or things I can look at here? Thanks!

hello.

have you created a simple page on that site? if so, post it here so that we can see if there's anything wrong with it or if it's a configuration problem...


I have done a simple page on the test site (which works) and the exact same page in the existing site (which doesn't work) so I'm not sure the code provides any value. But here is another clue. When I add the trigger to the update panel through the designer, switch to code view, and then back to designer I get an "error creating control"

It says: Triggers could not be initialized. Triggers could not be added to the collection. Details: Object does not match target type.

Here is the web page code:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="IssueTest.aspx.cs" Inherits="ProjectTrack_IssueTest" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Untitled Page</title> </head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"> </atlas:ScriptManager> <asp:DropDownList ID="ClientsDDL" runat="server" DataSourceID="RDI_DB" DataTextField="CO_NAME" DataValueField="Client_ID" OnSelectedIndexChanged="ClientsDDL_SelectedIndexChanged" AutoPostBack=true> </asp:DropDownList><atlas:UpdatePanel runat="server" ID="UpdatePanel1" Mode="Conditional"> <Triggers> <atlas:ControlEventTrigger ControlID="ClientsDDL" EventName="SelectedIndexChanged" /> </Triggers> <ContentTemplate> <asp:DropDownList ID="ProjectsDDL" runat="server" DataTextField="PROJ_NAME" DataValueField="PROJECT_NO" AppendDataBoundItems=true AutoPostBack="True" OnSelectedIndexChanged="ProjectsDDL_SelectedIndexChanged"><asp:ListItem>Select a client</asp:ListItem> </asp:DropDownList> </ContentTemplate> </atlas:UpdatePanel> <asp:DropDownList ID="PhaseDDL" runat="server" DataTextField="DESCRIPTION" DataValueField="PHASE" AppendDataBoundItems=true AutoPostBack="True"><asp:ListItem>Select a project</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="TaskDDL" runat="server" DataTextField="TASK" DataValueField="TASK" AppendDataBoundItems=true><asp:ListItem>Select a phase</asp:ListItem> </asp:DropDownList> <asp:SqlDataSource ID="RDI_DB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [Client_ID], [CO_NAME] FROM [CLIENTS]"></asp:SqlDataSource> <asp:SqlDataSource ID="ProjectListDB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [PROJECT_NO], [PROJ_NAME] FROM [PROJ_NO] WHERE ([CLIENT_ID] = @.CLIENT_ID)"> <SelectParameters> <asp:ControlParameter ControlID="ClientsDDL" Name="CLIENT_ID" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="PhaseListDB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [PHASE], [DESCRIPTION] FROM [PHASE] WHERE (([CLIENT_ID] = @.CLIENT_ID) AND ([PROJECT_NO] = @.PROJECT_NO)) ORDER BY [DESCRIPTION]"> <SelectParameters> <asp:ControlParameter ControlID="ClientsDDL" Name="CLIENT_ID" PropertyName="SelectedValue" Type="Int32" /> <asp:ControlParameter ControlID="ProjectsDDL" Name="PROJECT_NO" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="TasksListDB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [TASK], [DESCRIPTION] FROM [TASK] WHERE ([PHASE] = @.PHASE)"> <SelectParameters> <asp:ControlParameter ControlID="PhaseDDL" Name="PHASE" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource>   </form></body></html>

hello.

tell me something: can you run the following code with success:

<atlas:scriptmanager runat="server" id="manager" enablepartialrendering="true" />

<atlas:updatepanel runat="server" id="panel">
<contenttemplate>
<asp:button runat="server" Text="Submit" />
<%=DateTime.Now.ToString() %>
</contenttemplate>
</atlas:updatepanel>


Same results... in my existing web site it causes a postback. In my test web site it does an ajax update (no postback). Does that tell you anything? Thanks.

hello again.

one more question:

open the previous page on the browser, right click on it and look at the source code. find the script element that is used to load the js file (you might have several elements that user the webresource.axd on the page; in this case, you'll have to repeat it to all the items you find). copy the address that is in the src attribute of the script element and add it to the url of the page you have in the browser (you'll probably have to delete a portion of the url before adding the value you've copied from the source file).

can you get the file? ie, can you get the js atlas file? if you can't get the file (you should see the tradidional save dialog), then you have a iis configuration problem...

Problem Adding Declarative Script to a Content Page

Problem Adding Declarative Script to a Content Page - I get this error:

"Assertion failed: could not find HTML element with ID "Wait" for control type Sys.UI.Image"

I have the following:

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True">

</atlas:ScriptManager>

<scripttype="text/xml-script">

<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">

<components>

<image id="Wait" visibilityMode="Collapse" />

</components>

</page>

</script>

<imgid=Waitrunat=serversrc="Images/spinner.gif"/>

Server controls do not always have the same client ID as the ID you specify - instead, they are given a unique ID based on what naming containers they live in. If you do a View Source on the client, you'll see this.

There are two ways to solve this:

1) Don't make the img a server control. This makes sense if you're not doing anything dynamic with the image on the client - there's no value in making it a server control.

2) If you do need to make the image a server control, you can obtain the ClientID property of the control and databind that into your script:

<image id="<%# Wait.ClientID %>" visibilityMode="Collapse" />

You'll need to call DataBind on the page (or on a container control that contains the script) to get this databinding to happen.

Thanks,



Thank you.

Side question: Does it matter 'where' on the page the xml script tags are located?

The reason I ask: In the examples they are usually located outside of the form tags - but since the content pages do not have form tags.

Thanks again for the quick response.

Problem adding ToolkitScriptManager dynamically

Hi All,

Please help me I am stuck and can not go ahead without resolving this issue.

I have created a post(http://forums.asp.net/p/1141711/1838544.aspx) in Asp.net Ajax Extension Discussion forum but I think for this issue this forum is more appropriate.

Our website has no of pages and I do not want to add ToolkitScriptManager in every file and I want to add it in my base page. I am trying to add ToolkitScriptManager dynamically as suggested in threadhttp://forums.asp.net/p/1039254/1777798.aspx in OnPreInit event. But I am getting exception "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." What could be reason?

Here is code...

protectedoverridevoid OnPreInit(EventArgs e)

{

if (ToolkitScriptManager.GetCurrent(this.Page) ==null)

{

ToolkitScriptManager Manager =newToolkitScriptManager();Manager.EnablePartialRendering =true;foreach (Control cinthis.Controls)

{

if (cis System.Web.UI.HtmlControls.HtmlForm)

c.Controls.AddAt(0, Manager);

}

}

}

Here is exception

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

Line 519: if (c is System.Web.UI.HtmlControls.HtmlForm)Line 520:Line 521: c.Controls.AddAt(0, Manager);Line 522: }Line 523: }

Any idea what could resolve this issue?

Thanks, V

Hi,

As the error message indicates, there are code blocks in your page, so you can't modify Controls collection.

For instance:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server">
public string hello = "hello";
protected override void OnPreInit(EventArgs e)
{
if (AjaxControlToolkit.ToolkitScriptManager.GetCurrent(this.Page) == null)
{
AjaxControlToolkit.ToolkitScriptManager Manager = new AjaxControlToolkit.ToolkitScriptManager();
Manager.EnablePartialRendering = true;
foreach (Control c in this.Controls)
{
if (c is System.Web.UI.HtmlControls.HtmlForm)
{
c.Controls.AddAt(0, Manager);
break;
}

}

}

}

protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = DateTime.Now.ToString();
}
</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
<input value=<%=hello%> />

</div>
</form>
</body>
</html>

It can be solved by assigning the input control's text in code behind.

1. Mark it as runat server

2. In page_load, add : idOfTheInputControl.Value = hello;

Hope this helps.

Problem adding toolkit to the web.config on my server

I am trying to add the toolkit to my server's web.config so that I do not have to register the toolkit on each page that I use the extenders on. I have added the following config items but am receiving the error listed below when I attempt to use a control. Is there an issue with using the extenders on master pages? Everything works fine from a VWD perspective, intellisense picks up the toolkit controls just fine. The error only occurs on the server. Any help would be greatly apprectiately.

I have added the following to the <compilation><assemblies> section:

<add assembly="AjaxControlToolkit, Version=1.0.10618.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

I have also added the following within the <system.web> section:

<pages>
<controls>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />
</controls>
</pages>

Error text:


Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message:Unknown server tag 'ajaxToolkit:TextBoxWatermarkExtender'.

Source Error:

Line 48: ErrorMessage="User Name is required." Display="dynamic" ToolTip="User Name is required." ValidationGroup="ctl00$ctl00$Login1">*</asp:RequiredFieldValidator>Line 49:Line 50: <ajaxToolkit:TextBoxWatermarkExtender id="wm1" runat="server" TargetControlID="UserName" WatermarkText="Username" />Line 51: </td>Line 52: </tr>

The problem turned out to be an issue with the AJAX Extension configuration in the web.config. To fix it I just copied the info from the web.config from the Extensions install directory.


I am trying to do this right now too. Could you provide a little more detail about your fix? Where is the Extensions install directory? And what info did you copy from the web.config?

Also, how do I determine what the proper assembly info to use (i.e. version# and public key token...)

Thanks!


The path for the Extensions install directory on my dev machine is:

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025

That should be the default path for the AJAX Extensions installer.

Located in that folder should be a web.config file. All of the info in there needs to be copied into the web.config for your app. You'll have to make sure you aren't duplicating sections if you just paste the whole bit in your config. Posted below is a direct copy of the web.config for your convenience.

As for the issue of knowing which version and public token, I just take those from the samples. In the case of the Extensions, the config below lists the correct info and you shouldn't have to change it. For the case of the toolkit, the version will be the same as the release you are currently using. As for the public token, I'm not entirely sure about that as I have not updated my toolkit to the newest release. If you figure that out post back here to have it documented. (I'll do the same when I upgrade)

I hope this helps solve your issue.

<configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <system.web> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </controls> </pages><!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <compilation debug="false"> <assemblies> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </assemblies> </compilation> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </httpModules> </system.web> <system.web.extensions> <scripting> <webServices><!-- Uncomment this line to customize maxJsonLength and add a custom converter --> <!-- <jsonSerialization maxJsonLength="500"> <converters> <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/> </converters> </jsonSerialization> --> <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. --> <!-- <authenticationService enabled="true" requireSSL = "true|false"/> --> <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and writeAccessProperties attributes. --> <!-- <profileService enabled="true" readAccessProperties="propertyname1,propertyname2" writeAccessProperties="propertyname1,propertyname2" /> --> </webServices><!-- <scriptResourceHandler enableCompression="true" enableCaching="true" /> --> </scripting> </system.web.extensions> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated" /> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </handlers> </system.webServer></configuration>

Problem in adding a new AJAX tool

Hi ..

In my project, I have this problem:

We know that update panel does not work with FileUpload control. But I found that there is a FileUpload tool specially for AJAX, I found it in this link:

http://www.asp.net/community/control-gallery/browse.aspx?category=32

and I install it.

The problem that after I installed it. I did not know when I should put FUA.dll file. Is it inside ASP.NET ? if true . Where inside it cuz there are alot of folders ?

Can you help me in my problem Crying?

With my best regards, kholood A

Hi,

I am afraid you should refer to the Author of theFileUpload tool for support.

Good luck!