login button not working in content page with url rewrites

Last Reply on Mar 29, 2016 11:34 PM By ps222

Posted on Mar 28, 2016 06:22 AM

Dear sir ,

i am sucess implemnt url rewite in my site all working fine.

but when i use previous url then login button and signup not working 

#stq&stp=1 come in end of url ..

 

please resolve this issue 

Working url

http://easyshiksha.com/Engineering

non-working url

http://easyshiksha.com/search.aspx?q=Jaipur%20Engineering%20College,%20Kukas%20(JEC,%20Kukas)&loc=&course_level=&course_map1=&course_map2=&states=1

Results 1 - 5 of 9 12
Posted on Mar 28, 2016 08:33 AM

Will you please share your complete code.


Posted on Mar 28, 2016 11:25 PM

i have many pages in my site with master page .

every page commit with master page . i have a login window in master page ..its work every page perfect .

but when i url rewrite of serch page then he work perfect when url rewrite .

easyshiksha/engineering

rewrite 

http://easyshiksha.com/search.aspx?q=&loc=&course_level=&course_map1=btech &course_map2=&states=1

but when i going with previous url with query string there login not work no error there. only end of url write  see  #stq&stp=1

my master page code for login he is in master page ..

protected void m_log_Click(object sender, EventArgs e)
    {
        ds = new DataSet();
        string sql2 ="Select * From user_Information where email=@email2 and password=@password2 ";
        cmd2 = new SqlCommand(sql2);
        cmd2.Parameters.AddWithValue("@email2", m_email_signin.Value);
        cmd2.Parameters.AddWithValue("@password2", m_password_signin.Value);
        ds = obj.selectds1(cmd2, "user_Information");
        //ds = obj.select("Select * From user_Information where email='" + m_email_signin.Value + "' and password='" + m_password_signin.Value + "'", "user_Information");
        if (ds.Tables["user_Information"].Rows.Count > 0)
        {
            HttpCookie login = new HttpCookie("user_login");
            login.Value = ds.Tables["user_Information"].Rows[0]["user_id"].ToString();
            login.Expires = DateTime.Now.AddYears(1);
            Response.Cookies.Add(login);
           // string choice = HttpUtility.UrlEncode(Encrypt(ds.Tables[0].Rows[0]["education_interest"].ToString()));
            string choice = ds.Tables[0].Rows[0]["education_interest"].ToString();
            //Response.Redirect(string.Format("users.aspx?q={0}&loc=&course_level=&course_map1=&course_map2=", choice));
            Response.Redirect("users.aspx?q="+choice+"&loc=&course_level=&course_map1=&course_map2=");
        }
          else { inc_login.Style.Add("display", "inline"); showp.Style.Add("display", "none"); }
    }

url rewrite

<rule name="Rewrite Rule"> <match url=".*" /> <conditions> <add input="{StaticRewrites:{PATH_INFO}}" pattern="(.+)" /> </conditions> <action type="Rewrite" url="{C:1}" /> </rule>


Posted on Mar 29, 2016 01:15 AM

when click on login button end of url .

http://easyshiksha.com/search.aspx?q=IFLUX%20IIT%20&MEDICAL%20ACADEMY%20(COACHING%20CLASSES%20V11%20TO%20X11TH%20)&loc=&course_level=&course_map1=&course_map2=&states=1#stq=&stp=1

 

this is come in url ..

 


Posted on Mar 29, 2016 02:14 AM

Hi ps222,

Try to add below line in the Page_Load event of the master page.

protected void Page_Load(object sender, EventArgs e)  
{  
    form1.Action = Request.RawUrl;
}  

Here 'form1' is the asp form used in the master page.


Posted on Mar 29, 2016 02:17 AM

i try it advance ...sir ..