Click here to Skip to main content
15,884,628 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Approach on getting rid of server side validation Pin
jkirkerx23-May-12 10:04
professionaljkirkerx23-May-12 10:04 
GeneralRe: Approach on getting rid of server side validation Pin
Fabio Franco23-May-12 10:19
professionalFabio Franco23-May-12 10:19 
GeneralRe: Approach on getting rid of server side validation Pin
jkirkerx23-May-12 11:44
professionaljkirkerx23-May-12 11:44 
GeneralRe: Approach on getting rid of server side validation Pin
Fabio Franco23-May-12 16:14
professionalFabio Franco23-May-12 16:14 
GeneralRe: Approach on getting rid of server side validation Pin
jkirkerx24-May-12 5:37
professionaljkirkerx24-May-12 5:37 
GeneralRe: Approach on getting rid of server side validation Pin
Fabio Franco24-May-12 8:32
professionalFabio Franco24-May-12 8:32 
AnswerRe: Approach on getting rid of server side validation Pin
vvashishta25-May-12 2:41
vvashishta25-May-12 2:41 
QuestionJavascript and code-behind button events Pin
MattFFunke22-May-12 6:13
MattFFunke22-May-12 6:13 
I'll try to condense this as much as I can and include only the relevant information.

This works:
C#
protected void Page_Load(object sender, EventArgs e)
{
    string hey = "<script language=JavaScript>alert(\"Agh!\");</script>";
    this.RegisterClientScriptBlock("key", hey);

... much snipped for brevity ...

... but this doesn't:
C#
 ... in Page_Load():

    Button saveStart = new Button();
    saveStart.Text = "Save";
    saveStart.Click += new System.EventHandler(Save_Click);
}

protected void Save_Click(object sender, EventArgs e)
{
    CheckInitialization();

... much snipped for brevity...

protected void CheckInitialization()
{
    if (i == 64)
    {
        string hey = "<script language=JavaScript>alert(\"Agh!\");</script>";
        this.RegisterClientScriptBlock("key", hey);

... much snipped for brevity...

Any idea why not? I've run it through the debugger and verified that the "if" conditional is entered. For some reason, though, I don't see the alert box in the second code.

Am I opening it on the server, perhaps? If so, what can I do with RegisterClientScriptBlock to get it to run on the client?

I'd appreciate any insight you could lend.
AnswerRe: Javascript and code-behind button events Pin
Raj589122-May-12 7:52
Raj589122-May-12 7:52 
GeneralRe: Javascript and code-behind button events Pin
MattFFunke22-May-12 8:03
MattFFunke22-May-12 8:03 
AnswerRe: Javascript and code-behind button events Pin
jkirkerx23-May-12 13:05
professionaljkirkerx23-May-12 13:05 
QuestionHow do I find control IDs on one page from another? Pin
sa4720k22-May-12 4:44
sa4720k22-May-12 4:44 
QuestionPopup Window Pin
Member 387988122-May-12 2:46
Member 387988122-May-12 2:46 
AnswerRe: Popup Window Pin
R. Giskard Reventlov22-May-12 6:27
R. Giskard Reventlov22-May-12 6:27 
AnswerRe: Popup Window Pin
vvashishta25-May-12 2:43
vvashishta25-May-12 2:43 
QuestionASP.NET GridView Row Footer Pin
LSkhosana22-May-12 1:06
LSkhosana22-May-12 1:06 
AnswerRe: ASP.NET GridView Row Footer Pin
vvashishta25-May-12 2:44
vvashishta25-May-12 2:44 
QuestionMachine.config Pin
Member 387988121-May-12 6:50
Member 387988121-May-12 6:50 
AnswerRe: Machine.config Pin
Not Active21-May-12 6:57
mentorNot Active21-May-12 6:57 
GeneralMessage Removed Pin
21-May-12 7:26
Member 387988121-May-12 7:26 
GeneralRe: Machine.config Pin
Not Active21-May-12 7:42
mentorNot Active21-May-12 7:42 
QuestionAuto postback on a text control triggered by clicking on listview Pin
cahigg21-May-12 3:19
cahigg21-May-12 3:19 
Questionsetting focus to a button Pin
mathew6800720-May-12 21:33
mathew6800720-May-12 21:33 
AnswerRe: setting focus to a button Pin
Abhinav S20-May-12 21:47
Abhinav S20-May-12 21:47 
GeneralRe: setting focus to a button Pin
Jack Li22-May-12 19:26
Jack Li22-May-12 19:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.