Click here to Skip to main content
15,908,931 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello All
how can show dialog in asp.net by using java script and this show dialog text pass from code behind to java function
Posted
Comments
Shafeequl 30-May-13 4:15am    
jst try with alert in javascript
Try something. You will find a lot of examples by searching in Google.
ahmed hussein khazal 30-May-13 5:05am    
i find alert in java but i need develop it by pass text show dialog from code behind asp.net

Hi Friend Try this.....


XML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function ShowDia() {
            var msg = document.getElementById("<%=txtMessage.ClientID %>").value;
            alert(msg);
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Enter the Message :
        <asp:TextBox ID="txtMessage" runat="server"></asp:TextBox>
        <asp:Button ID="btnShowDialog" runat="server" Text="Show Dialog" OnClientClick="ShowDia();" />
    </div>
    </form>
</body>
</html>
 
Share this answer
 
Below is the sample


ASPX Code

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
<script>
alert('<%=message%>');
</script>
</body>
</html>


C# Code
public partial class MyPage : System.Web.UI.Page
{
public string message;
protected void Page_Load(object sender, EventArgs e)
{
message = "Server Side Message";
}
}
 
Share this answer
 
Simplest solution:
XML
Response.Write("<script type='text/javascript'>");
Response.Write("alert('Write this code in code behind.');");
Response.Write("</script>");
 
Share this answer
 
thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900