Subject: Where did my website dll go?
Posted By: mega Post Date: 5/16/2006 8:54:43 AM
Hi all.

I just moved to ASP.NET 2.0 and some things confuse me. Like where is the dll that used to get dropped in my bin folder? I guess it's because ASP.NET compiles at runtime..
Another thing is where is the server-side controls defined? Usually there is a protected definition of each control at the top of my .cs file, now there's none - but it still works. What is going on behind the scenes and how can I be sure that no old controls lives somewhere in my page class?
Also, I got a problem with Server.UrlEncode/Decode. In ASP.NET 1.x I could type in characters like æ, ø and å as querystring values and (I guess because ASP.NET is in Unicode-16) ASP.NET converted it automatically between pages. Now it just remove characters that's not ASCII (or so it seems)! What should I do?
I tried this approach:
sender page

string s = String.Format("infopage.aspx?Headline={0}&Infotext={1}&Buttontext={2}&Uri={3}",
    Server.UrlEncode("Booking udført"),    // Headline
    Server.UrlEncode("Din booking er nu registreret hos Prime."),    // Infotext
        Server.UrlEncode("Fortsæt..."),    // Buttontext
    Server.UrlEncode("bookings.aspx"));    // URI
Response.Redirect(s);

receiver page

lblHeadline.Text = Server.UrlDecode(Request.Params["Headline"]);
lblInfotext.Text = Server.UrlDecode(Request.Params["Infotext"]);
btnForward.Text =  Server.UrlDecode(Request.Params["Buttontext"]);

Thanks in advance.

 - mega
Moving to C# .NET
Reply By: Imar Reply Date: 5/16/2006 12:46:57 PM
Hi mega,

Yes, you're right. Because of the new run-time compilation model, pages are compiled at run time, so you won't see a DLL anymore (although at run-time the pages are still compiled to separate DLL assemblies).

Also, because of the new model, you no longer need a separate control declaration in the code behind. This used to be necessary because the markup and the code behind where actually two different classes. With the new model, they are compiled together using partial classes. So, whenever you drop a new control on a page, you can automatically see in the code behind. What you see in the markup is what you actually have; no "lost" controls.

If you prefer the old model, take a look at Web Application Projects. You may also want to look at the new Web Deployment Project.

Does this help?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Reply By: mega Reply Date: 5/16/2006 1:08:03 PM
Yes, that clarifies a lot. Thanks.

Still a bit puzzled about event handling in 2.0 - I'll get back with a bunch of questions about that later... ;-)
Anyway do you have any clue about why my special characters don’t convert correctly?

Regards, Jon.

 - mega
Moving to C# .NET
Reply By: Imar Reply Date: 5/16/2006 1:33:18 PM
I am not sure if this will fix your problem, but you could take a look at this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfglobalizationsection.asp

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

Go to topic 44344

Return to index page 286
Return to index page 285
Return to index page 284
Return to index page 283
Return to index page 282
Return to index page 281
Return to index page 280
Return to index page 279
Return to index page 278
Return to index page 277