Sharepoint 2013: My sharepoint solution doesn't contain default.aspx page - c#

I created a sharepoint application in which I added a web app item , but the problem i didn't find the default.aspx page

Once you have the web application, you need at least a site collection to be able to navigate to. Once you create a site collection, every site in it (including the root site) will have a page called Home.aspx - that's the default one for SharePoint, not default.aspx - which you can browse. Also by default, navigating to a site's URL without a page name in the URL will lead you to Home.aspx.
Edit, to answer OP's comment:
i created a new web part in visual studio in order to deploy it in my Sharepoint site. In visual studio , i created an empty sharepoint project in which i added a web part to it , the problem i didn't find the default.aspx page in the project that i created
Web part and visual web part projects don't include pages. You may include a page in a module if you wish, but you will have to create it yourself.
Also, visual web parts are more like user controls than ASP.NET pages. You create these to add to web part zones pages. If you want to deploy pages, you might want to choose another project type.

Related

Accessing web forms from Masterpage navigation menu

I am creating a web application in Asp.net and c# where I have a master page in which there is a Left Side Navigation menu containing the links to different web forms. But these web forms are in different locations. For example ClientDetails.aspx and UserDetails.aspx are present at the root and AdminHome.aspx is present in the Admin folder where my master page resides.
So when I click on Client on Navigation menu, it opens nicely but from this place when I click on Admin Home in the nav to redirect back to Admin home page, it gives an error as
The resource cannot be found.
How can I handle this?
When specifying the URL for you pages, it should be in is format with the tilda as shown below:
Client Details
User Details
Admin Home
You will need to check the URL those menu items are redirecting to. Ensure that the relative path for the forms is correct based on current forms location. Take a look at this page to understand how paths work.

Get Site URL stored in solution properties SiteURL

Currently working on creating custom function for a SharePoint site, i have inserted Site URL on the SharePoint project folder, is it possible i retrieve the Site URL from the project properties to use in .cs file within it?
Site URL in a project you set for the possibility to deploy solution to SharePoint via Visual Studio. If you want to get current Web url from code you can use SPContext:
SPContext.Current.Site.Url - for the site collection url,
SPContext.Current.Web.Url - for the current Web url.

Navigation is not working on aspx page

I am developing a web app in asp.net web forms with master page. Application is running in debug mode in my localhost. When I click on the link in menu it navigates but when I again click on any link in menu it gives me the resource cannot be found.
The problem is a location issue. Make sure you are calling the file in the right directory.
If you are Redirecting from the Server-Side then use
Response.Redirect("~/MyFolder/MyPage.aspx");
or from the Client-Side
href="../MyFolder/MyPage.aspx"
This is assuming that you have the MasterPage in its own folder in the project.
u should try giving the links using ResolveClientUrl,I had the same problem..!!
<a href='<%=ResolveClientUrl("~/Folder/Page.aspx") %>'>LinkName</a>

Load asp.net website inside winform C#

I have a(n) (MDI) Windows Form application. It contains two forms. One form (Measured data) controls an engine, another form (laboratory) should show my asp.net web site that has various assignments for the user to do.
How can I show the asp.net default page in that laboratory form? I'm using awesomium to make a browsing window in my laboratory form.
Doing the following
webView.LoadURL("file:///D:/school/4e%20jaar/Erasmus/ErasmusProject/Laboratory/deault.aspx");
gives an error. Probably because the asp.net site isn't online. but how can I run the site so I can see the default.aspx page?
I have on solution with three projects
ErasmusProject
ASP.NET website
SIMOclasses
SIMOForm
The problem is you cannot execute aspx files with file:/// path.
You have to execute on IIS.
So first thing you have to do setup iis if you didnt, create new web site (or use Default Web Site) to execute your aspx files, than change your link file:/// to http://localhost or something.
The URL you've specified looks like its accessing the raw file via the file system. i.e. file:///D:/.../default.aspx.
(You've also misspelt 'default' in your question!)
Can you access that URL from a browser (e.g. IE, Firefox, etc) and see the content you want? I suspect you can't and that you're missing the webserver that is compiling and serving the .aspx pages.
You should host your website first :
WebDev.WebServer /port:9999 /path:"C:\Projects\MyWebSite"

facebook application asp.net javascript file errors

I have created asp.net application and hosted on facebook.
but i cannot refer the javascript files .
they are referred in aspx pages as "Scripts/Jquey.js"
but while rendering application page in facebook.
it tries to look for.
url/page.aspx/Scripts/Jquery.js
which it cant find.
how to overcome this
If your path is relative to the root you should include the tilde, otherwise it will just be treated as relative to the page itself i.e. ~/Scripts/Jquery.js.

Categories