Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey all,

 

I got a webform on my site that needs to assign a different server side include depending on the previous page the user was on.

 

The selection process is good and it works, the only thing remaining is to find a way to add variations of

 

<!--#Include virtual="html\top.inc" -->

 

to my page.

 

I have tried this:

 

[size=2][color=#0000ff]Dim[/color][/size][size=2] q [/size][size=2][color=#0000ff]As [/color][/size][size=2][color=#0000ff]Char[/color][/size][size=2] = Chr(34)

[/size]me.lblTop.text = [size=2]"<!--#Include virtual=" & q & "html\top.inc" & q & " -->"[/size]
[size=2]

[/size]

 

 

Any help would be appreciated.

 

Thanks

Laredo512

* using VS.NET Pro 2003 *

Posted
Because it's only a switch between french and english links in plain html and I don't really want to use a database query just for that.

Laredo512

* using VS.NET Pro 2003 *

Posted

A public cookies?

or you can write a special type file in the temp director,save the user's information in it .

The another server's site can use the temp file..

Posted

Because the #include will spawn the old ASP engine if I remember correctly. Not to mention it's a maintnance nightmare... it's just bad practice to mix classic ASP with ASP.NET and there are some mentions of it out there being a performance hit. This is how you load a user control dynamically:

 

Preferably you have a place holder control, or a panel, or somewhere to load it specifically.

 

Then:

 

Me.MyPlaceHolder.Controls.Add(LoadControl("~/Folder/Control.ascx"))

 

or in C#:

 

this.MyPlaceHolder.Controls.Add(LoadControl("~/Folder/Control.asxc"));

 

MyPlaceHolder in this example represents a place holder control already on the form. Use any control you'd like that allows controls to be added.

 

If these weren't dynamic controls you'd just drag them on the form and designer from the solution explorer.

Posted
Because the #include will spawn the old ASP engine if I remember correctly. Not to mention it's a maintnance nightmare... it's just bad practice to mix classic ASP with ASP.NET and there are some mentions of it out there being a performance hit. This is how you load a user control dynamically:

 

Preferably you have a place holder control, or a panel, or somewhere to load it specifically.

 

Then:

 

Me.MyPlaceHolder.Controls.Add(LoadControl("~/Folder/Control.ascx"))

 

or in C#:

 

this.MyPlaceHolder.Controls.Add(LoadControl("~/Folder/Control.asxc"));

 

MyPlaceHolder in this example represents a place holder control already on the form. Use any control you'd like that allows controls to be added.

 

If these weren't dynamic controls you'd just drag them on the form and designer from the solution explorer.

Thanks, I'll be trying that

Laredo512

* using VS.NET Pro 2003 *

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...