Pop-up with radiobuttons - c#

I have a registration page where i have a register button and when it is clicked i have to get a pop up with radio buttons like parent and child.How to do this without javascript?I am using c# and asp.net.
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True"
Visible="False">
<asp:ListItem>parent</asp:ListItem>
<asp:ListItem>child</asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<cc1:ModalPopupExtender ID="RadioButtonList1_ModalPopupExtender" runat="server" PopupControlID="form1"
DynamicServicePath="" Enabled="True" TargetControlID="Button1">
</cc1:ModalPopupExtender>
</div>
</form>
</body>

Easiest way to do this is using JQuery. I suggest you to give it a try.

You could just submit what the user has done so far, and direct to a different page with those radio buttons.
Or make a link to pop-up a new window to the radio buttons perhaps.
Or use css hoveron effect to mimic a popup block, thought this doesn't work like buttons.

Related

Duplicate web form on button click

I have an ASP web form that includes divs, checkboxes, textboxes, buttons and dropdowns. Backend is c#.
I have an "Add" button at the bottom that when clicked, I want it to duplicate my form below the existing one.
Other than copying my form multiple times and toggling visibility based on a button click, is there some way I can put my form in a class and call on it based on the button click? Or any other way? Would think gridview is an option but I use divs within the form which is not allowed in gridview.
For Example:
<form id="form" runat="server">
<asp:ScriptManager ID="MainScriptManager" runat="server" />
<asp:UpdatePanel ID="updatepnl" runat="server">
<ContentTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
<asp:Button ID="add" runat="server" Text="Add" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
The Add button can be moved outside of the update panel if necessary. But I would like to duplicate the form below the original via clicking the Add button. Would also be handy if I could have a remove option as well.

In IE11,IE10 Page postbacks occur when button is clicked

In my code on running from local Postback did not occur on button trigger click,but when i run through production url and click button complete Postback occurs.How to handle page postback in IE11,IE10.In all the other browsers it works fine with no postback of page.I googled ut did not get the solution for IE.
keep your all controls into update panel
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>

Ajax control toolkit editor is not showing correctly

i am new in asp.net and i am working on the thing where i had to add HTML Editor Extender (Ajax Toolkit). but it does not appear correctly.
Click [here] (http://s24.postimg.org/56f3vdv0l/error.png)!
I used this code...-->
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<cc1:Editor ID="Editor1" runat="server" width="600px" Height="200px"/>
<asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" /><br/><br/>
<asp:Label ID="Label1" runat="server"
Text=""></asp:Label>
</div>
</form>
After a lot of searching, I found my solution to the same problem... use this:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
instead of:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
Good luck!
This would allow use of the Editor control, rather than extending the Textbox (which I actually like that method as well).
hi please check the htmlEditorExtender sample from ajax control site.
you need to assign it to a textbox so that it will be extended to a Realtime HTML Editor.
you need to assign toolbar properties to the html extender control.
hope this helps

Create Loading animation before navigating to another page and disable all conrols on it during animation

I have a button on Page 1 and when the button click event occurs, I had to do some process that takes around 2-3 seconds. So, I want to Put a Loading Image in Center and disable all other controls on the Page 1.
I tried using UpdatePanel :
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button runat="server" Text="Button" onclick="Unnamed1_Click" />
<asp:Label runat="server" Text="Label" ID="lbl"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" >
<ProgressTemplate>
<div id="IMGDIV1" align="center" valign="middle" runat="server" style="position: absolute;visibility:visible;vertical-align:middle;border-style:none;border-color:black;background-color:transparent;">
<asp:Image ID="Image1" runat="server" ImageUrl="~/ajax-loader (1).gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
But the controls did not get disabled. Any Solution or Javascript ??
Also I want that it should work if want to stay on the same page.
why dont yu use telerik radgrid loading panel ?
http://www.telerik.com/help/aspnet-ajax/ajax-center-loadingpanel.html

modal pop up extender

What I'm doing is creating a list of tickets using a ListView. One of the controls in the item template is a link button that shows the header of the ticket. When the user clicks the link button, I want to open a modal window that shows the ticket in readable format. To get the ticket, I'll be passing that page a variable and it'll do the rest; nothing complicated. The page will have 3 buttons and the windows needs to close when you click one of them.
Now, I figured out how to use the ModalPopupExtender from the Ajax tookit more or less. You create the panel in it's own div which stays hidden. I created a click event that basically uses a webclient to download the html from the page and insert it into that div's innerHtml. This seems to work the first time. But as soon as you click a different link, the page pukes and says something about it being in an illegal state.
I'm not sure if I'm going about this wrong, and I can't find any decent examples of how to do this. Well there's one, but the english is hard to understand and it's in VB instead of C#. Any help?
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<form id="form1" runat="server">
<div><asp:toolkitscriptmanager id="ToolkitScriptManager1" runat="server"> </asp:toolkitscriptmanager>
<br />
<asp:modalpopupextender dropshadow="true" okcontrolid="btnOk" cancelcontrolid="btnClose" runat="server" popupcontrolid="Panel1" id="ModalPopupExtender1" targetcontrolid="Button1" />
<asp:panel id="Panel1" runat="server" cssclass="modalPopup" style="display: none;"> This is basic modal popup. <br /><br />
<asp:Button ID="btnOk" runat="server" Text="Ok" /> <asp:Button ID="btnClose" runat="server" Text="Close Me" />
<iframe src="http://www.google.com"></iframe>
</asp:panel>
<asp:button id="Button1" runat="server" text="First Modal Popup" />
</div>
</form>

Categories

Resources