alert problem
-
Here i am using the following javascript for alert a msgwindow.problem is, it is opening new page and giving the message,How to alert the same in the same page??It is happening on a button click event. ---> if txt1.text="" then Response.Write(" alert(' Enter username,it shd not be null '); ") end if
kissy
-
Here i am using the following javascript for alert a msgwindow.problem is, it is opening new page and giving the message,How to alert the same in the same page??It is happening on a button click event. ---> if txt1.text="" then Response.Write(" alert(' Enter username,it shd not be null '); ") end if
kissy
-
Both are giving same result.my requirement is the message shd be displayed on the same form,not like response.write() .It directs to different page.
kissy
u should add attributes on the button click add following code on your html page
function chktxt() { if (document.getEelementById("textbox1").value='') { alert('Enter Some Value'); } }
and add following code on your .vb page in page_load eventbutton1.attributes.add("onclick","return chktxt();")
check and reply me quick -
Here i am using the following javascript for alert a msgwindow.problem is, it is opening new page and giving the message,How to alert the same in the same page??It is happening on a button click event. ---> if txt1.text="" then Response.Write(" alert(' Enter username,it shd not be null '); ") end if
kissy
Use this....enjoy :) RegisterClientScriptBlock("Alert", "alert('Purchase Invoice save successfully')");
Dinesh Sharma Team Leader (Software Development)
-
u should add attributes on the button click add following code on your html page
function chktxt() { if (document.getEelementById("textbox1").value='') { alert('Enter Some Value'); } }
and add following code on your .vb page in page_load eventbutton1.attributes.add("onclick","return chktxt();")
check and reply me quickThis is working perfectly. But my doubt here is,this is working for testing textboxes, If i want to display after Add_Button,i am displaying message "Records were added",here i am dipslaying with a label.In this case can i display by using script for simply " Records were added"
kissy
-
Use this....enjoy :) RegisterClientScriptBlock("Alert", "alert('Purchase Invoice save successfully')");
Dinesh Sharma Team Leader (Software Development)
-
This is working perfectly. But my doubt here is,this is working for testing textboxes, If i want to display after Add_Button,i am displaying message "Records were added",here i am dipslaying with a label.In this case can i display by using script for simply " Records were added"
kissy
-
sd1 = "Insert into Producing_Agency(pa_id,pname)values(1,'"&txtname.text&"') pains = New SqlCommand(sd1, dbconn) pains.ExecuteNonQuery() Lbldisplay.Text = "Record Added" Here i am using Lbldisplay for displaying the message in the same form. can i disply by using the below in the same form , Response.Write(" alert(' Record inserted '); ") my doubt is Reposne.write means,this message is displying in other page.It directs otherpage.This is my doubt.
kissy
-
sd1 = "Insert into Producing_Agency(pa_id,pname)values(1,'"&txtname.text&"') pains = New SqlCommand(sd1, dbconn) pains.ExecuteNonQuery() Lbldisplay.Text = "Record Added" Here i am using Lbldisplay for displaying the message in the same form. can i disply by using the below in the same form , Response.Write(" alert(' Record inserted '); ") my doubt is Reposne.write means,this message is displying in other page.It directs otherpage.This is my doubt.
kissy
No, Kissy response.write meanse writing some text on the same page as you wrote code i tried the same to my page but i got the message on the same page, it didn't redirected me any other page. i think you must check your .aspx page code. Regards Ravi :-O
-
Here i am using the following javascript for alert a msgwindow.problem is, it is opening new page and giving the message,How to alert the same in the same page??It is happening on a button click event. ---> if txt1.text="" then Response.Write(" alert(' Enter username,it shd not be null '); ") end if
kissy
Try using a Server side Label label1.Text = "Textbox Error"; label1.Visible = false; if(error) Label1.Visible = true; :)
keep Learning and you never will be out of date...
-
Here i am using the following javascript for alert a msgwindow.problem is, it is opening new page and giving the message,How to alert the same in the same page??It is happening on a button click event. ---> if txt1.text="" then Response.Write(" alert(' Enter username,it shd not be null '); ") end if
kissy
use this: Page.RegisterStartupScript("MyScript(any script name)", "alert('Message...');"
Regards, Rashida Jabeen http://www.akaas.net[^]