Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP.NET AJAX and mm.net business web forms
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01176111
Message ID:
01177365
Views:
8
Any client script you add to the page should get created with ScriptManager, not with this.Page.ClientScript which UpdatePanel now ignores in MS Ajax Beta2. ScriptManager has matching script methods to those of ClientScript.

I think ideally what you'd want is to put the button into the update panel or into another updatepanel that is triggered the same way as the main panel.

+++ Rick ---

>Hi Rick,
>
>Thanx for the heads up. I got everything installed and modified on one of my simple mm.net web forms. Actually all I did was drop SciptManager on the form. Then I dropped UpdatePanel on the form, being careful to insure the ScriptManager is above UpdatePanel or you get an error.
>
>Then I simply dragged over a server button (btnSubmit) and label (lblQuadrant) onto UpdatePanel. I set a couple of properties on UpdatePanel so that I get an AsynPostBack and to acknoedge the click of btnSubmit. When I click btnSubmit, lblQuadrant gets it’s text property updated without the full postback. That is so cool. But now the rub. The sever-side method code in the click event of btnSubmit is:
>
>protected void btnSubmit_Click(object sender, System.EventArgs e)
>{
>  int jj;
>  CheckBox oChk;
>  // upper right adult teeth
>  for (jj = 1; jj<=52; jj++)
>  {
>	oChk = (CheckBox)this.FindControl("chk" + jj.ToString());
>	if (oChk.Checked)
>	{
>         this.lblQuadrant.Text = this.lblQuadrant.Text +  "<li>" + oQuadrants[jj, 1] + "  (" + oQuadrants[jj, 2] + ")" + "</li>";
>
>        this.btnLetter.Enabled=true;
>        }
>}
>
>
>
>Notice that the method code also sets btnLetter.Enabled=true;
>Since btnLetter is not in the UpdatePanel, it does not get Enabled. Could I register a StartupScript on the page from this method to run when the UpdatePanel updates?
>
>I was hoping that the following script could run when UpdatePanel updates.
>The script that I think will work is below. But how do I hook it into the AJAX scheme of things?
>
>
>System.Text.StringBuilder myScript = new System.Text.StringBuilder();
>                myScript.Append("<script language='javascript'>");
>                myScript.Append("\n  var oBut= document.getElementById(‘btnLetter’);");
>                myScript.Append("\n oBut.setAttribute(‘disabled’,false)”);
>                myScript.Append("</script>");
>                Page.ClientScript.RegisterStartupScript(this.GetType(), "EnablebtnLetter", myScript.ToString(), false);
>
>
>
>
>
>>>Hi,
>>
>>>I am intrigued by Microsoft’s asp.net ajax framework and would like to start adding some of it's functionality to my web applications. Are there any white papers on hooking the ajax framework into new and existing mm.net web forms?
>>
>>There's no real need to do anything special with MS Ajax since it doesn't really directly interact with existing control behaviors. There may be some issues with generated script code and UpdatePanels but MM Web Forms do very little of that, so this should not be an issue.
>>
>>The hardest part in all of this likely will be adding the MS Ajax libraries and web.config settings - you'll need to map the web.config settings from the installation into your Web apps .config file.
>>
>>++++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform