Sunday, June 19, 2011

LogIn PopUp

Open Login box in a PopUp


<head>
<link href="highslide/highslide.css" rel="stylesheet" type="text/css" />
<script src="highslide/highslide-with-html.js" type="text/javascript"></script>

<script type="text/javascript">
hs.graphicsDir = 'highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
</script>
</head>
---------------------

<td align="left" class="verdana10normalcream">

<a href="user/register.aspx" class="arial11normalwhite"
onclick="return hs.htmlExpand(this, { objectType: 'iframe' } )"> new user?</a>

</td>
----------------------------------------
(Register.aspx)
----------------------------------------
<asp:RadioButtonList ID="rblUserType" ToolTip="Select a User Type!!" CssClass="treb14normaldarkred" runat="server" CellPadding="1" CellSpacing="3" Height="122px" Width="196px">
<asp:ListItem Value="1">Project Lister</asp:ListItem>
<asp:ListItem Value="2">Professional</asp:ListItem>
<asp:ListItem Value="3">Franchisee</asp:ListItem>
</asp:RadioButtonList>

-----------------------------------------
(Code on register.aspx)
protected void btnContinue_Click(object sender, ImageClickEventArgs e)
{
if (rblUserType.SelectedIndex == -1)
{
// below script also works
//string javaScript =
// "<script language=JavaScript>\n" +
// "alert('please select before proceeding!!');\n" +
// "</script>";
//Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", javaScript);


}
else
{
string scriptString;

switch (Convert.ToInt32(rblUserType.SelectedItem.Value))
{
case 1:
scriptString = "<script language=JavaScript>" +
"window.opener.document.forms(0).submit(); window.close();</script>";
if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptString))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"script", scriptString);
}
Response.Write("<script>window.top.location=\"../Lister/register_lister.aspx\"</script>");
break;


case 2:
scriptString = "<script language=JavaScript>" +
"window.opener.document.forms(0).submit(); window.close();</script>";
if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptString))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"script", scriptString);
}
Response.Write("<script>window.top.location=\"../Prof/register_contractor.aspx\"</script>");
break;


case 3:
scriptString = "<script language=JavaScript>" +
"window.opener.document.forms(0).submit(); window.close();</script>";
if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptString))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"script", scriptString);
}

Response.Write("<script>window.top.location=\"../Franchisee/register_franchisee.aspx\"</script>");
break;

}
}
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More