如何在按钮单击时打开ASP.NET中的多个弹出窗口

问题描述:

在我的按钮中单击我正在使用if和else条件



如果块显示一个弹出窗口

和Else Block显示另一个弹出窗口



喜欢这个



in my button click i am using if and else condition

if block show's one popup
and Else Block Show another Popup

like this

if (Session["id"] == null)
{
      //one popup 
}
else
{
    //Second pop up Show
}





我是什么尝试过:



我的按钮:





What I have tried:

my button:

<>< asp:Button ID =btnAvailabiltyrunat =serverclass =btn btn-successText =Check AvailabilityOnClick =btnAvailabilty_Click/>
<><asp:Button ID="btnAvailabilty" runat="server" class="btn btn-success" Text="Check Availability" OnClick="btnAvailabilty_Click" />





这是一个弹出窗口





This is One popup :

 <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog" style="width:444px;">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
         
        </div>
        <div class="modal-body">
		<form style="margin: 0px 5px 0px 5px;">
  <div class="form-group">
    <label for="exampleInputEmail1">Email address</label>
    <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">Password</label>
    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
  </div>
  <%--<div class="form-group">
    <label for="exampleInputFile">File input</label>
    <input type="file" id="exampleInputFile">
    <p class="help-block">Example block-level help text here.</p>
  </div>--%>
  <div class="checkbox">
    <label>
      <input type="checkbox"> Check me out
    </label>
  </div>

</form>

<div class="modal-footer"><br />
        <button type="button" class="btn btn-primary" >Login</button>
        <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Sign Up</button>
      </div>
        </div>
      </div>
      
    </div>
  </div>







这是第二个弹出窗口






this is Scond popup

<div  data-toggle="modal" data-target="#myModal"></div>

  <!-- Modal -->
  <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog" style="width:444px;">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Request to Book</h4>
        </div>
		<div class="col-md-6">
		<br />
		<label>NAME</label>
		<input type="text" placeholder="USER NAME" class="form-control">
		<br />
		<label>EMAIL</label>
		<input type="text" placeholder="EMAIL ID" class="form-control">
		<br />
		<label>MOBILE</label>
		<input type="text" placeholder="Mobile Number" class="form-control">
		<br />
		<textarea type="text" rows="5" placeholder="Note" class="form-control"></textarea>
		</div>
		<div class="col-md-6">
		<br /><label>Select Event Type</label>
		<select class="form-control Select Event Type">
					<option value="">-Select Event Type-</option>
					<option value="wedding-reception">Wedding / Reception</option>
					<option value="meeting">Meetings</option>
					<option value="conference">Conference</option>
					<option value="private-party">Private Party</option>
					<option value="birthday-party">Birthday Party</option>
		</select>
		<br />
		<label>BUDGET</label>
		<input type="text" placeholder="Budget" class="form-control"/>
		<br />
		<label>BOOK BY</label><br />
		<input type="radio" name="person"/> &nbsp; Per Person
		<br />
		<label>EVENT DATE</label>
		<input type="text" placeholder="Event Date" class="form-control"/>
		<br />
		<label>NUMBER OF GUESTS</label>
		<input type="text" placeholder="Number Of Guests" class="form-control"/>
		
		</div>
		
        <div class="modal-footer">
         <button type="submit" class="btn btn-primary" style="margin-top:30px;">Submit</button>
        </div>
      </div>
      
    </div>
  </div>

refer this thread to call javascript method from code behind



c# - Calling JavaSc ript Function From CodeBehind - Stack Overflow[^]
refer this thread to call javascript method from code behind

c# - Calling JavaScript Function From CodeBehind - Stack Overflow[^]