get the value from prompt in javascript usign c#
  • hi,i want ti share how we can get the value from prompt and show it in label  :

    <%@ Page Language="C#" MasterPageFile="~/Orders.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Projet_Moghamarat.WebForm1" Title="Page sans titre" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type ="text/javascript" >

           function storeinput() {

                //Alert the prompt  and Get the value from prompt
                var value = prompt('Enter your concat name  .');

                //Assign the value to label control
                document.getElementById("<%=LabelShow.ClientID%>").innerHTML = value;


    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server" >

    <asp:Button ID="Button2" runat="server" Text="ShowContact"   OnClientClick="javascript:storeinput();return false;"/>

    <asp:Label ID="LabelShow" runat="server" ForeColor="Blue"></asp:Label>



Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week