call login page and register page in popup window in asp.net - asp.net

i have to design an website use asp.net
in this web site we have to use login and register
i use this code in master page
<asp:LoginView ID="Log_view" runat="server">
<AnonymousTemplate >
<span class="log_txt">Hi Guset! </span>
Rigster
Login
</AnonymousTemplate>
<LoggedInTemplate>
<asp:LoginName ID="Log_name" runat="server" CssClass="log_txt" FormatString="Hi, {0}!"/>
<asp:LoginStatus ID="LoginStatus1" runat="server" LogoutText="Logout" CssClass="log_lnk" LogoutPageUrl="~/Default.aspx" LogoutAction="Redirect" OnLoggingOut="LoginStatus1_LoggingOut" /> </LoggedInTemplate>
</asp:LoginView>
and its work without any problem, but the login page and register page will display normal, i want to display in popup window.
in other page i use this script to call page in popup window use AjaxControlToolkit and its work fine
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<span>
<a href="#" id="Rig_log" runat="server" > Rigister | Login </a>
</span>
<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="Rig_log" CancelControlID="btn_close" BackgroundCssClass="popup_Background">
</cc1:ModalPopupExtender>
<cc1:DragPanelExtender ID="Image1_DragPanelExtender" runat="server"
Enabled="True" TargetControlID="Panl1" DragHandleID="Panl1">
</cc1:DragPanelExtender>
<asp:Panel ID="Panl1" runat="server" CssClass="Popup" align="center" style = "display:none">
<div id="popup_header"> <span>Register | Login </span><a href="#" ID="btn_close" runat="server" > X </a></div>
<div id="popup_content"> <iframe id="irm1" src="Register_login.aspx" runat="server"></iframe></div>
</asp:Panel>
my issue is , how i can call login page and register page in popup, i try but it's not working
thanks

Hanashi,
You can try out java script below like this.
window.open(your page name);
Dinesh Nagrale

Related

Updating a field in an Master Page's UpdatePanel from CodeBehind

I've got a master page with a cart count at the top of my page inside an updatepanel, along with another updatepanel which wraps a search field tied a dropbox denoting search type. (The UpdatePanelSearch is tied to an AutoCompleteExtender and the Find dropdown at left sets the type of contextkey to be used when autocompleting)
I'm attempting to let code-behind code in a subordinate page (usually the user clicking or manipulating an inventory item of some sort) update the cart count.
Things I've tried:
If UpdatePanelCart and UpdatePanelSearch are both set with updatemode=automatic, UpdatePanelSearch stops reacting to updates of the Find dropdown.
The same happens if I use a single updatepanel to wrap both areas.
If I set UpdatePanelCart's UpdateMode to conditional, then UpdatePanelSearch works properly--but I don't have an obvious way (to me at least) of forcing the refresh of the cart count (i.e., I can set it to a new value in code a code-behind, but it won't actually be redrawn until the page is fully redrawn).
What's the correct strategy here? I'll admit I don't fully understand why #1 and #2 don't work (I suspect the AutocompleteExtender is the reason but I'm really just guessing)
Code for the Search panel follows:
<asp:UpdatePanel ID="UpdatePanelSearch" runat="server">
<ContentTemplate>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender2" runat="server"
CompletionInterval="150"
CompletionListCssClass="autocomplete_completionListElement"
ServiceMethod="GetCompletionList"
ServicePath="/atomic/Autocomplete.asmx"
TargetControlID="txtThingToFind"
UseContextKey="True"
CompletionSetCount="75">
</ajaxToolkit:AutoCompleteExtender>
<asp:Panel ID="Panel1" DefaultButton="cmdQuickFind" runat="server">
<div id="mainSearchArea">
<div id="searchLine">
<div id="signinArea">
<asp:Label ID="Label1" runat="server" CssClass="formfield-required"></asp:Label>
</div>
<asp:Panel ID="Panel2" DefaultButton="cmdQuickFind" runat="server">
<div id="searchArea">
<div class="row">
<div class="col-lg-8">
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Find <span class="caret"></span></button>
<ul class="dropdown-menu">
<li>
<asp:LinkButton ID="LinkButton1" runat="server">Comic Title</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LinkButton2" runat="server">Publisher</asp:LinkButton></li>
<li class="divider"></li>
<li>
<asp:LinkButton ID="LinkButton3" runat="server">Artist</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LinkButton4" runat="server">Writer</asp:LinkButton></li>
<li class="divider"></li>
<li>
<asp:LinkButton ID="LinkButton5" runat="server">Storyline</asp:LinkButton></li>
<li class="divider"></li>
<li>
<asp:LinkButton ID="LinkButton6" runat="server">1st Appearance</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LinkButton7" runat="server">2nd Appearance</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LinkButton8" runat="server">Origin</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LinkButton9" runat="server">Death</asp:LinkButton></li>
<li>
<asp:LinkButton ID="LinkButton10" runat="server">Special Appearance</asp:LinkButton></li>
<li class="divider"></li>
<li>
<asp:LinkButton ID="LinkButton11" runat="server">Advanced Find...</asp:LinkButton></li>
</ul>
</div>
<!-- /btn-group -->
<asp:TextBox ID="TextBox1" runat="server"
CssClass="form-control" AutoCompleteType="None" autocomplete="off"
placeholder="Find comic title or issue...">
</asp:TextBox>
<asp:Button runat="server" ID="Button1" Text="Go" CssClass="btn btn-primary" />
</div>
<asp:Panel runat="server" ID="Panel3" CssClass="findScope" Visible="false">
<label>Search: </label>
<asp:RadioButton ID="RadioButton1" runat="server" GroupName="findScope" AutoPostBack="True" />
<asp:RadioButton ID="RadioButton2" runat="server" Text="All sellers" Checked="True" GroupName="findScope" AutoPostBack="True" />
</asp:Panel>
</div>
<!-- /input-group -->
</div>
<!-- /.col-lg-6 -->
</div>
</asp:Panel>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
It seems at least one of my problems was my fuzzy understanding of the trigger mechanism for UpdatePanels.
The reason for behavior #1 (the Cart not updating) was that I hadn't placed the UpdatePanelCart closely enough around the cart label. Automatically updating UpdatePanels only update as a result to changes in their immediate child controls unless explicit postbacktriggers are defined. Since the UpdatePanel was wrapping the whole menu line, the automatic update didn't happen.
Behavior #2 (nothing on the page of any consequence updating if I attempted to wrap the whole page in an updatepanel) was related-- none of the controls I wanted to see update were immediate child controls, so this was going to fail.
The solution for me was to draw the updatepanels more narrowly, and do some extra CSS work to work around the formatting issues these inevitably caused to the menu.

A page can have only one server-side Form tag Issue

I have a masterpage like this
<%# Master Language="C#" MasterPageFile="~/masterpages/XmasShop.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="cphContents" runat="server">
<asp:LoginView runat="server" ID="lview1">
<LoggedInTemplate>
<div class="confirmation-cantainer">
<div class="confirm-01">
<form runat="server">
<umbraco:Macro Alias="[Xmas]ShopConfirm" runat="server"></umbraco:Macro>
</form>
</div>
</div>
</LoggedInTemplate>
</asp:LoginView>
</asp:Content>
<asp:Content ContentPlaceHolderID="cphAuthenticationPane" runat="server">
<asp:LoginView runat="server" ID="lview12">
<LoggedInTemplate>
<form runat="server">
<asp:LoginStatus ID="lslougout" runat="server" Style="float: right; color: #003263; text-decoration: none;" text="Logout"></asp:LoginStatus>
</form>
</LoggedInTemplate>
</asp:LoginView>
</asp:Content>
And you can see I have two form tags in it,but both are seperate not nested.Still I am getting an error
A page can have only one server-side Form tag.
Can any one suggest me a solution.When I tried to remove one of the forms its throwing an error elements must be inside a form tag and when I add form above error.
Use the following tutorial to set up two form tags and be able to toggle them on and off, as required:
http://jerschneid.blogspot.com/2007/03/hide-form-tag-but-leave-content.html
One solution is to have the login information on a separate page. You could also look into using an iframe.
This error occurred due to use of more than one
<form runnat="server">
tag.
Remove one of the form tag.
This would be more clear by visiting this link

HTML5 attribute "required" inside UpdatePanel, not working (asp.net 4)

In my .aspx file, I have an UpdatePanel with some textboxes and a button. If I add the "required" attribute to the textboxes, the postback stops working. I can see in Firebug that it's not posting at all. If I remove the "require" attribute, it's working as it should. Am I doing something wrong here, or is it a way to fix it?
The code for the UpdatePanel:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%# GetComments (DataBinder.Eval(Container, "DataItem.id")) %>
<div class="contact_form">
<ul>
<li>
<h2>Skriv en kommentar til oss!</h2>
</li>
<li>
<asp:TextBox ID="txtName" runat="server" CssClass="txtBox" placeholder="Ditt navn" required />
<span class="form_hint">Ditt navn skal stå her</span>
</li>
<li>
<asp:TextBox ID="txtCaptcha" runat="server" CssClass="txtBox" required placeholder="Skriv resultatet av 10 pluss 6 her" />
<span class="form_hint">Du klarer vel å regne ut 10+6? :-)</span>
</li>
<li>
<asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" required placeholder="Din kommentar" />
</li>
<li>
<asp:Button ID="cmdSaveComment" CssClass="button" runat="server" CommandName="SaveComment" CommandArgument='<%# Eval("id")%>' Text="Puliser kommentar" />
</li>
</ul>
</div>
</ContentTemplate>
</asp:UpdatePanel>
I guess you don't get error. So, if required field specified, an input field must be filled out before submitting the form.
try giving some value in the textboxes.
EDIT
Though, I should have mentioned my previous answer as a comment. However, this seems to be a bug mentioned here.

asp login - open a new window if authentication is successful

I need to open a new window if the authentication of a users login is successful. is there an easy way to have the DestinationPageUrl open in a new window using something like target="_blank" ? below is my code:
<body>
<form id="form1" runat="server">
<div>
<br />
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" DestinationPageUrl="~/Public/Index.aspx" OnAuthenticate="Login1_Authenticate">
</asp:Login>
</AnonymousTemplate>
<LoggedInTemplate>
Welcome User
</LoggedInTemplate>
</asp:LoginView>
<br />
</div>
</form>
</body>
I would code the page with two controls, one for login. Once the login is successful, hide the login and display your form. No redirect necessary.

How can I add an invitation dialog to my facebook application (using ASP.Net)

I'm developing a facebook application, using IFrame instead of FBML. I have a main page with a sub-iFrame inside. In the inner iframe (the invitation page) I have:
<%# Register Assembly="Facebook.Web" Namespace="Facebook.Web.FbmlControls" TagPrefix="cc1" %>
<cc1:Fbml ID="Fbml1" runat="server" Xfbml="True">
<ContentTemplate>
<cc1:RequestForm ID="RequestForm1" runat="server" Method="Post" Type="Xfbml" Xfbml="True"
Invite="True" Content="Invite your friends" Action="." Visible="True">
<ContentTemplate>
<cc1:MultiFriendSelector ID="MultiFriendSelector1" runat="server" Rows="3" Xfbml="True"
ShowBorder="True" EmailInvite="True" Bypass="Cancel" ActionText="Select Friends you want to invite">
</cc1:MultiFriendSelector>
</ContentTemplate>
</cc1:RequestForm>
</ContentTemplate>
</cc1:Fbml>
This doesn't work at all and when I view the frame source, I get:
<fb:fbml>
<fb:request-form type="Xfbml" Content="Invite your friends" action="." method="POST">
<fb:multi-friend-selector actiontext="Select Friends you want to invite" showborder="true" email_invite="true" rows="3" bypass="cancel"></fb:multi-friend-selector>
</fb:request-form>
</fb:fbml>
Any ideas and/or suggestions are very appreciated. Thanks for reading anyway

Resources