Click here to Skip to main content
15,912,069 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: problem in executing javascript from an update panel. Pin
Pranay Rana17-May-10 19:52
professionalPranay Rana17-May-10 19:52 
AnswerRe: problem in executing javascript from an update panel. Pin
Brij17-May-10 19:53
mentorBrij17-May-10 19:53 
Questionhow to compare two word files Pin
koolprasad200317-May-10 19:07
professionalkoolprasad200317-May-10 19:07 
AnswerRe: how to compare two word files Pin
Sandeep Mewara17-May-10 19:28
mveSandeep Mewara17-May-10 19:28 
GeneralRe: how to compare two word files Pin
koolprasad200317-May-10 20:02
professionalkoolprasad200317-May-10 20:02 
GeneralRe: how to compare two word files Pin
Sandeep Mewara17-May-10 20:31
mveSandeep Mewara17-May-10 20:31 
QuestionDataList HeaderTemplate Problem Pin
jitendrafaye17-May-10 18:02
jitendrafaye17-May-10 18:02 
QuestionHttp Post Pin
Dot-Net-Dev17-May-10 17:51
Dot-Net-Dev17-May-10 17:51 
Hi,
I am working with the HTTP Post method to log the user into my framework. But when I run the page it does not redirect to the Page given in URL. What I am doing wrong?

Following is my code:

string strResponse;
string strPost;

protected void Page_Load(object sender, EventArgs e)
{
strPost = "txtUserName=abc&txtPassword=123";

UTF8Encoding objUTFEncode = new UTF8Encoding();
byte[] arrRequest = null;
Stream objStreamReq;
StreamReader objStreamRes;
HttpWebRequest objHttpRequest;
HttpWebResponse objHttpResponse;
Uri objUri = new Uri("http://www.mysite.com");

objHttpRequest = HttpWebRequest.Create(objUri) as HttpWebRequest;
objHttpRequest.KeepAlive = false;
objHttpRequest.Method = "POST";

objHttpRequest.ContentType = "application/x-www-form-urlencoded";
arrRequest = objUTFEncode.GetBytes(strPost);
objHttpRequest.ContentLength = arrRequest.Length;
objStreamReq = objHttpRequest.GetRequestStream();
objStreamReq.Write(arrRequest, 0, arrRequest.Length);
objStreamReq.Close();

CookieContainer cookieContainer = new CookieContainer();
objHttpRequest.CookieContainer = cookieContainer;

//Get response

objHttpResponse = objHttpRequest.GetResponse() as HttpWebResponse;
objStreamRes = new StreamReader(objHttpResponse.GetResponseStream(), Encoding.ASCII);

strResponse = objStreamRes.ReadToEnd();
objStreamRes.Close();
}


Thanks
AnswerRe: Http Post Pin
Not Active17-May-10 18:06
mentorNot Active17-May-10 18:06 
Questionusercontrol event Pin
Dhyanga17-May-10 7:06
Dhyanga17-May-10 7:06 
AnswerRe: usercontrol event Pin
Not Active17-May-10 7:12
mentorNot Active17-May-10 7:12 
GeneralRe: usercontrol event Pin
Dhyanga17-May-10 7:16
Dhyanga17-May-10 7:16 
AnswerRe: usercontrol event Pin
Rutvik Dave17-May-10 7:29
professionalRutvik Dave17-May-10 7:29 
GeneralRe: usercontrol event Pin
Dhyanga17-May-10 7:36
Dhyanga17-May-10 7:36 
GeneralRe: usercontrol event Pin
Dhyanga17-May-10 7:37
Dhyanga17-May-10 7:37 
GeneralRe: usercontrol event Pin
Rutvik Dave17-May-10 7:41
professionalRutvik Dave17-May-10 7:41 
GeneralRe: usercontrol event Pin
Dhyanga17-May-10 7:45
Dhyanga17-May-10 7:45 
GeneralRe: usercontrol event Pin
Rutvik Dave17-May-10 8:00
professionalRutvik Dave17-May-10 8:00 
GeneralRe: usercontrol event [modified] Pin
Dhyanga17-May-10 8:03
Dhyanga17-May-10 8:03 
GeneralRe: usercontrol event Pin
michaelschmitt17-May-10 8:40
michaelschmitt17-May-10 8:40 
GeneralRe: usercontrol event Pin
Dhyanga17-May-10 9:11
Dhyanga17-May-10 9:11 
GeneralRe: usercontrol event Pin
Not Active17-May-10 9:52
mentorNot Active17-May-10 9:52 
GeneralRe: usercontrol event Pin
Dhyanga17-May-10 9:55
Dhyanga17-May-10 9:55 
GeneralRe: usercontrol event Pin
PunkIsNotDead17-May-10 13:55
PunkIsNotDead17-May-10 13:55 
GeneralRe: usercontrol event Pin
Not Active17-May-10 18:00
mentorNot Active17-May-10 18:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.