I output the header data in the for loop below that I am sending in my web
request and it isn't passing the keep alive, the connection, or the
credentials.  How do I put this stuff in the header?  Do I have to use the
webRequest.Header.Add instead of these things?  If so what is the format?   



if (authObj.NeedCredentials) {
        CredentialCache wrCache = new CredentialCache();
        wrCache.Add(new Uri(authObj.URI), authObj.RequestMethod, new
NetworkCredential(authObj.UserID, authObj.Password, "FileDriveWWW"));
        webrequest.Credentials = wrCache;
}
        
webrequest.AllowAutoRedirect = false;
webrequest.ContentType = "text/html";
webrequest.PreAuthenticate  = true;
webrequest.UserAgent = authObj.UserAgent;
webrequest.KeepAlive = true;
webrequest.Connection = authObj.URI;
                        
StringBuilder s = new StringBuilder("REQUEST HEADERS");

for(int i = 0; i < webrequest.Headers.AllKeys.Length; i++) {
        String Key =    webrequest.Headers.GetKey(i);
        s.Append(Key + ":" + webrequest.Headers[Key] + "\n");
}




Travis D. Falls |Consultant, Raft.Net IT | 860.547.4070 |
[EMAIL PROTECTED]
 
 

-----Original Message-----
From: Charles Carroll [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 13, 2005 3:15 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] StringWriter and HTMLTextWriter


http://www.learnasp.com/freebook/learn/literalsrock.aspx
You just assign this to a literal.

You don't need the HTMLTextWriter for this

DIM q as string = """"
dim sbTempHTML as new stringbuilder
with sbTempHtml
     .append("<td valign=")
     .append(q & "true" & q)
      .append("color=")
       .append(q & "brown" & q)   
end with

BUT I stronnglyu suspect the fact you are asking this at all is
because you are taking the wrong approach to converting the code.

PLEASE send me the original ASP page off list to
[EMAIL PROTECTED]
and I will give you the correct conversion of it to ASP.net. It seems
unlikely to me that the way we are discussing is the best way.


On Thu, 13 Jan 2005 13:44:53 -0000, scaevola637 <[EMAIL PROTECTED]>
wrote:
>  
>  If I want to create HTML in the code behind to appear in an <%= %>
>  block on the aspx page, what is the best way?  I would like to use
>  HTMLTextWriter but not sure that is possible.  The trouble is, in C# I
>  do not know how to concatenate all those """ that exist in HTML.  For
>  instance:
>  <!-- code  
>  <td valign="true" color="brown">
>  -->
>  HTMLTextWriter makes all this much easier to do, but is is possible in
>  the page_load method to create a string to assign to <%= mySTr %>?
>  
>  I hope so
>  
>  
>  
>  
>  ________________________________
>  Yahoo! Groups Links
>  
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>   
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


 
Yahoo! Groups Links



 




This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all 
copies.



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to