Showing posts with label reading. Show all posts
Showing posts with label reading. Show all posts

Thursday, March 22, 2012

system.object to namevalue collection

I'm reading some stuff in a custom section of the
web.config file into a name value collection. What do I
need to do to make this work:

Dim nvcConfig As NameValueCollection = _
ConfigurationSettings.GetConfig
("myApp/mySection ")

With option strict on?See:

http://msdn.microsoft.com/library/d...ionsections.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.

"Charles" <a@.b.c> wrote in message
news:0b3c01c36e2f$fca64820$a401280a@.phx.gbl...
> I'm reading some stuff in a custom section of the
> web.config file into a name value collection. What do I
> need to do to make this work:
> Dim nvcConfig As NameValueCollection = _
> ConfigurationSettings.GetConfig
> ("myApp/mySection ")
> With option strict on?

Tuesday, March 13, 2012

System.Threading.ThreadAbortException and Response.Redirect

I have an ASP.net 2.0 app on a W2K3 box. I am using Response.Redirect inside page_load. After reading a bunch of posts, I've tried setting the second arg to false, but still get the error. I've also tried moving the redirect outside the try block. No love. I catch and ignore the error, but the redirect doesn't redirect to the new url.

All worked fine until this started happening out of the blue.

Thanks.

I assume you meant to post your code... but you forgot. Can you post your problem code please?


oops. Sorry.

If Request.QueryString("testnum") Is Nothing Then
Response.Redirect("http://localhost:10607/WWW/testing.aspx?testnum=1.11-.01-C1-T1&ucid=0")

End if


Have you tried using a relative URL, instead of an absolute URL?

The thing is, the built in web server in Visual Studio (Cassini) uses dynamic port assignment. Therefore, there is no guarantee (in fact no likelihood at all) that the port used will be the same every time.

Try a URL of"~/testing.aspx?testnum=1.11-.01-C1-T1&ucid=0"