Click here to Skip to main content
15,909,896 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Databind image from database Pin
Ashish Sehajpal4-Apr-08 21:30
Ashish Sehajpal4-Apr-08 21:30 
QuestionHOW TO MAINTAIN DYNAMICALLY CREATED CONTROLS AFTER POSTBACK C# Pin
Phivos Stylianides4-Apr-08 10:14
Phivos Stylianides4-Apr-08 10:14 
AnswerRe: HOW TO MAINTAIN DYNAMICALLY CREATED CONTROLS AFTER POSTBACK C# Pin
Ashish Sehajpal4-Apr-08 23:43
Ashish Sehajpal4-Apr-08 23:43 
GeneralRe: HOW TO MAINTAIN DYNAMICALLY CREATED CONTROLS AFTER POSTBACK C# Pin
kontax5-Apr-08 2:54
kontax5-Apr-08 2:54 
AnswerRe: HOW TO MAINTAIN DYNAMICALLY CREATED CONTROLS AFTER POSTBACK C# Pin
Fatania Dipak2-Feb-09 1:09
Fatania Dipak2-Feb-09 1:09 
GeneralWindows Services and ASP.NET Pin
ffowler4-Apr-08 10:06
ffowler4-Apr-08 10:06 
GeneralRe: Windows Services and ASP.NET Pin
ffowler5-Apr-08 16:44
ffowler5-Apr-08 16:44 
Generalhttpwebrequest multipart/form data boundary Pin
n3w8134-Apr-08 9:59
n3w8134-Apr-08 9:59 
Hi, I have been trying to get this to work for a few days and tried searching everywhere but can't seem to find anything about this.

I am trying to login and make a post to a site. I have no problem logging into the site, however, when I go to make a post, nothing happens. After using Fiddler and comparing the results of the webbrowser and httprequest it looks like the boundary changes at each login.

For instance it will be this one time:
Content-Type: multipart/form-data; boundary=---------------------------7d829cb4c0502

and then it will be something like this (just slightly different) the next time:
Content-Type: multipart/form-data; boundary=---------------------------7d82b824c0502

I am trying to figure out how to get this information from the headers. Here is part of my code

<code>

httpWebRequest myRequest =(HttpWebRequest)WebRequest.Create(urlUri);
myRequest.CookieContainer = cookies;
myRequest.Method = "POST";
myRequest.AllowWriteStreamBuffering = true;
myRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)";
myRequest.Referer = "urlReferer";
myRequest.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, */*";

Stream newStream = myRequest.GetRequestStream();

newStream.Write(buffer,0,buffer.Length);

newStream.Close();

HttpWebResponse myHttpWebResponse = (HttpWebResponse)myRequest.GetResponse();
HttpWebResponse resp = (HttpWebResponse)myRequest.GetResponse();
string[] names = resp.Headers.AllKeys;
string headerInfo = "";
Console.WriteLine("{0,-20}{1}\n", "Name", "Value");
foreach (string n in names)
headerInfo = headerInfo + <br /> + n + ": " + resp.Headers[n]; // Get the headers

resp.Close();
return headerInfo;

</code>

but this always returns

Content-Type: text/html

for the header instead of

Content-Type: multipart/form-data with the form boundary after it.

Is there anyway I can get the header information? I know it has to be possible.

Thanks
GeneralRe: httpwebrequest multipart/form data boundary Pin
led mike4-Apr-08 11:44
led mike4-Apr-08 11:44 
AnswerRe: httpwebrequest multipart/form data boundary Pin
n3w8135-Apr-08 16:21
n3w8135-Apr-08 16:21 
QuestionGrey Out Check Box in GridView ItemTemplate? Pin
Cyndie4-Apr-08 8:37
Cyndie4-Apr-08 8:37 
AnswerRe: Grey Out Check Box in GridView ItemTemplate? Pin
Cyndie10-Apr-08 10:17
Cyndie10-Apr-08 10:17 
GeneralGrid alignment within table Pin
JacquesDP4-Apr-08 8:34
JacquesDP4-Apr-08 8:34 
GeneralRe: Grid alignment within table Pin
led mike4-Apr-08 11:23
led mike4-Apr-08 11:23 
GeneralRe: Grid alignment within table Pin
Guffa4-Apr-08 17:18
Guffa4-Apr-08 17:18 
GeneralRe: Grid alignment within table Pin
JacquesDP5-Apr-08 1:01
JacquesDP5-Apr-08 1:01 
GeneralRe: Grid alignment within table Pin
Ashish Sehajpal4-Apr-08 21:24
Ashish Sehajpal4-Apr-08 21:24 
GeneralRe: Grid alignment within table Pin
JacquesDP5-Apr-08 1:03
JacquesDP5-Apr-08 1:03 
QuestionCascading Dropdownlists Pin
PaaKay4-Apr-08 7:22
PaaKay4-Apr-08 7:22 
GeneralProblem Getting while building project Pin
hari4ur4-Apr-08 5:01
hari4ur4-Apr-08 5:01 
GeneralRe: Problem Getting while building project Pin
sagittarian4-Apr-08 6:10
sagittarian4-Apr-08 6:10 
GeneralRe: Problem Getting while building project Pin
hari4ur5-Apr-08 0:10
hari4ur5-Apr-08 0:10 
GeneralFixed Rows to Datalist Pin
sjs4u4-Apr-08 4:51
sjs4u4-Apr-08 4:51 
GeneralCommunicator API Pin
alexfromto4-Apr-08 4:11
alexfromto4-Apr-08 4:11 
GeneralRe: Communicator API Pin
led mike4-Apr-08 4:23
led mike4-Apr-08 4:23 

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.