Embedded Resources and ASPX pages - asp.net

Is it possible to embed an aspx page (self contained, no seperate codebehind file) into an assembly, in this case a SharePoint web part, and have it still act as an aspx file when called via the resource url?
Regards
Moo

no as such. however you can change you web part to a user control and enbed that in a webpart and a a aspx file.
Google for "user Control Web Part"
OR
you can look at "son of smartpart" but I don't like this approach. not very pure.
OR
Leave it as a aspx page and use the page viewer web part to load the aspx page in an iframe from sharepoint.

Download the Web Deployment Project update from MS, and it will solve your problem.
http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en

You could use an httphandler but then you would have to make changes to web.config. What is your real problem? You can easily deploy a separate ASPX page when you use something like WSPBuilder to create your SharePoint code.

Related

How to update a Kentico Aspx Template Page?

I created a template page, and a page that uses that template in Kentico. So I edited the aspx template file, but the changes arent being updated when viewing the page in the CMS. I turned off caching and everything, but I cannot get my changes viewable.
If you use web application (there are .designer.cs files in your solution) you have to rebuild the app. Or you can try changing Codebehind to CodeFile in your aspx markup.(Not really clean method but will ensure file gets build dynamically as they do under web site).
If you use web site and you tried to delete cache (CMS Site Manager->Administration->System->Clear cache) you are doing something wrong, believe me.
As a last resort you can try to clear asp.net temporary files
(C:\Windows\Microsoft.NET\Framework64\your version\Temporary ASP.NET Files). This will need IIS to be restarted.
Differences between web app. and web site are described here.

Link to aspx page from asp.net mvc project

I have asp.net mvc project with razor views and i have in the same solution another project that is rendering (aspx) pages (reports and stuff) so i don't know how to call that page or show it inside view. i have tryed with render action and link but it just can't be found.
It's just one aspx page inside other project so i have path like: /projectName/page.aspx
Any help would save my day
If you have two web projects I suppose they have two iis mapping.
So calling from a site to another site you use href link, to render a page from another site the only thing I can think of is using iframe.

How register a subclass of a web control in an ASP.NET website?

I would like to subclass an ASP.NET control, like UpdatePanel, and use the subclass in my web site. I know if I move the code to a separate assembly I would be able to reference the assembly from within Register phrase but I wonder if there is a way to keep all the code inside the website.
Would appreciate to have your help.
Sure, you can put code files in App_Code if you are using the web site project template, or if you are using the web application project template, the code can be within a folder in the web site.
Note that the name of the assembly in web site project templates is App_Code, and for web app projects its the name defined as the assembly name in the project settings.
Do you know which template you are using?
When it comes to custom controls, sometimes you may run into issues, especially if you want to change the existing behavior of updatepanel.
HTH.

adding pages in live asp.net site dynamically without redeploying or recompiling?

Is there some way to add .aspx pages in live asp.net site without need to recompile or redeploy ? Please guide me.
thanks
I do not exactly understand what do you mean by "no recompile or redeploy", but:
If you use Asp.Net web site(and not web application) you can just copy aspx file with it's cs file to the web site directory and it will work.
You can simply upload aspx and cs page to the given location. If you publish your site you can upload only page related dll and aspx page.

Using your SharePoint site Master Page on all application pages

I am new to share point. i would like to add custom .aspx pages in share point. this i was able to do it using this blog http://chiragrdarji.wordpress.com/2007/10/12/add-aspx-page-to-sharepoint-2007/#comment-3540 .. now i would to inherit the share point's master page in my asp.net application and implement some controls. can any one help me out regarding this?
thanks and regards
malathy.L.
Using the sharepoint master page in another app is not going to work. It has a bunch of sharepoint specific controls on it that your custom app won't recognize. It is much easier to put all your app's logic (i.e. all controls now in an ASPX page) in a USerControl and use those on ASPX pages in SharePoint.
Then to be able to use these controls you need to do either of these options:
Then deploy either by putting the .ascx files in the CONTROLTEMPLATES folder in SHarePoint's 12 hive and the DLL in the bin folder / Global Assembly cache. If you go for the BIN folder you would probably need to write CAS Policy files though. This is the most secure method.
use the SmartPart.
I'm guessing you are very new to SharePoint , but want to urge you to consider packaging all this up in a SharePoint Solution (a .wsp file) using a tool like WSPBuilder.
Also I would encourage you to read up on SharePoint Development / Deployment Best Practices check out this Checklist.

Resources