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 sense 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;
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.