how do add .ascx file into html page

Posted by Kannan1986 under ASP.NET on 2/12/2010 | Views : 10102 | Status : [Member] | Replies : 4
how do add .ascx file into html page




Responses

Posted by: Abhi2434 on: 2/12/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
In normal way you cant.

But if you want you can configure the html extension to be handled by your HttpHandler, then it is possible.

But why should you do that?
Rather you can place your module and add them when required.

You can also go with <!--#include--> to include html module from external files if you wish if you dont need server side code to run for your ascx controls.


www.abhisheksur.com

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RtpHarry on: 2/12/2010 [Member] [MVP] Bronze

Up
0
Down
You cant add it into a plain html page. You should convert the page to an aspx page.

If thats what you meant then the easiest way is to switch to design view then drag and drop the control from your solution explorer onto the design canvas.

This will put the required reference at the top and the control into the page. If it didnt land where you wanted then switch to source view and move it.

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bubbly on: 2/17/2010 [Member] Bronze

Up
0
Down
Hello,

You can check this link

http://bytes.com/topic/net/answers/106061-asp-net-includes-text-html-files-into-aspx-pages

Hope it helps

++
Thanks & Regards,
Deepika

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Up
0
Down
You can't add ascx or serverside scripts in html files. you can have a include tag. But that also should not contain any server side codes

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response