In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces how to embed ASP.NET applications, the content is very detailed, interested friends can refer to, I hope to help you.
Why embed ASP.NET applications into SharePoint? We don't discuss this! We'll discuss how to embed ASP.NET applications into SharePoint and the problems you might encounter.
Start of text:
Here we are building a Web application with a Demo.aspx page, the code is as follows:
namespace WebInMOSS { public partial class _Demo: System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Response.Write("Web Can In Moss"); } } } Compile this program to generate a WebInMOSS.dll file, copy this dll to the bin folder under the website directory, and add nodes:
Then put the Demo.aspx page into MOSS. You can choose to use SPD or upload the document library directly. We put it in Pages here. Browse pages/Demo.aspx in MOSS, do you want to delete autoeventwredup? Indeed, the page displays Web Can In Moss after AutoEventWidup ="true" is deleted, proving successful execution. To increase the complexity of the web application, put a button in Demo.aspx with the following events:
protected void Button3_Click(object sender, EventArgs e) { SPSite siteCollection = new SPSite("http://xuwei:8080"); SPWeb site = siteCollection.OpenWeb("/Docs/"); SPList list = site.Lists["Notification"]; SPListItemCollection items = list.Items; foreach (SPListItem item in items) { Response.Write(""); Response.Write(item["Title"].ToString()); } }
In VS2005 debugging results (please ignore the write session and read session 2 buttons):
Place the recompiled program dll,Demo.aspx in MOSS as before. Re-browse, Onclick event appears again at this time, cannot be used, how to do it? We must enable MOSS's safe mode to execute server-side events. The operation is as follows:
We find the node in the Web.config file,
Add a virtual path under the node
Declare that all files in this site allow server-side events, although you can specify which folder the virtual directory is, but this value must start with ~/or/and must end with a filename or *.
After saving Demo.aspx, browse the page, can display normally, click the listobject button(please ignore the write session and read session 2 buttons), OK, normal execution displayed!
Again increasing the complexity of the web application, adding Session,(no matter which way MOSS is developed, as long as it is integrated with your own program, you will always encounter Session problems).
The code is as follows:
protected void Button1_Click(object sender, EventArgs e) { Session["Count"] = "1"; } protected void Button2_Click(object sender, EventArgs e) { if (Session["Count"] != null) { Response.Write("
"+Session["Count"].ToString()+""); } }
After compiling and saving, browse the page again, click the listobject button to display the results normally, but when clicking Write Session, this prompt appears to be domineering! God knows what kind of accidental mistake! I tried to modify MOSS to display an error message, but failed. Looking up the Log file also did not find any trace, fortunately at the beginning expected that there may be problems with the Session, check Web.config found
Hehe, Session is closed by default, of course, it cannot be executed normally. Set it to true and save it. Browse demo.aspx page, click write session and read Session, it can be executed normally. The above describes embedding ASP.NET applications.
ASP.NET applications on how to embed the sharing here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 269
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.