ASPX website HTML Edit - c#

Good morning,
I have a website that I have to edit for a client, but the website is on a local web server that is designed in aspx. I am looking at all the files and when trying to change Form options I am unable to find the HTML code behind the runat=server
what i ultimately need to accomplish is to change the options in a dropdown menu that allows users to choose from.
I am sorry if i am unable to explain it in depth, my web programming is weak when dealing with this.

Once published, an asp.net site would compile the code behind into a dll, you cannot see the code, only the markup.
Solution is to edit your website in visual studio and republish.

Related

Can people find and download the Code File linked to your aspx page?

So I imported this aspx page done by a former dev who worked for the company I'm in now. I found that the aspx page left by him doesn't have a codebehind file so I assumed this wasn't the source code. I can't find the source so I added a code file and try to work it out on my own. But my main concern is this: clients can't access the code behind, right? Is a manually added code file subject to the same protection?
The codebehind file is there as a place to put your server side code. However it's technically not necessary to have one since you can put the code in the aspx file using c# script tags. It's however recommended to put it in the codebehind file for better separation between markup and code.
It does not matter if you add it yourself or if Visual Studio adds it for you. It does not change anything in terms of access. In all events it executes on the server.
If your server is properly configured to run ASP.NET applications - which I believe it is - then IIS will not serve .cs files to a client. These will normally be accessible only through FTP. Try it yourself, by browsing to any .cs file in your application :)
Also notice that what you get when you browse to an .aspx file is not the very same code you'd see in Visual Studio, but the result of that being processed. IIS will serve the resulting HTML. So even if you have server side code in the ASPX file, that won't be visible to an end user browsing through your application.
Sounds like a web application project; in this case, the code is in the code-behind file as #TGH mentioned, and the code would be in the DLL compiled for the web application. Therefore, the only way to get that code is use a tool like Telerik JustDecompile, and decompile that DLL to grab the source code for EVERY file in the project. It would be much better to have the source, as these decompile tools do not include everything in that code-behind file.

Do we have to re-publish the Web-site if we modify a part of the code in the aspx pages?

If we make a slight modification of the code in the C# page or in the aspx page, do we have to republish the entire web-site after the modification?
I am using VS-2008 professional and the code is written in C#.
It depends, if you are connnected to the website using a ftp connection (Solution showing as ftp://ftp.somewebsite.com) then your alterations will be updated real time. If you are using a local copy of the website (offline website), you need to publish the entire website once your are done.
So to answer your question we need more information about how you setup your website in the solution.
There are two case of modification:
UI (HTML Code), you can just click to refresh the browser without having to rebuild the solution
Server Code (C# code), you have to click F6 in VS2008 and rebuild the solution
It depends on which code you modify:
if you make a change to the asp markup of the aspx , than you don't have to.
if you change your code behind, then you will need to rebuild your
project therefore you have to republish it.

Use Java model in ASP.NET

I would like to use a java model. This is model of a human body. It has been written in Java, but I have to use it in ASP.NET. How can I do this? I tried the IKVM open source program. When I created a .dll I got a lot of not found warning. I have already installed the java sdk, and the eclipse. I could run java method under .NET. But I need a full model. Any idea?
Perhaps, - Could you please describe your setup in more detail?
What i gather from your question is that you have an ordinary ASPX page. In this page you would like to host a Java applet.
One suggestion could be to show the applet in an iFrame (read: no need for special DLL's).
In this case you could make a seperate HTML page embed the Applet as usual (:there are tons of howtos out there). And show it in the iFrame.
With this setup you might run in to issues with cross-side scripting, to fix this make sure that the host HTML page is loacted in the same domain as the ASPX page.
Good luck

Run a aspx page into a Sharepoint folder

I have a aspx page and I'd like to run it into a sharepoint folder. Is there a way to execute this page like a html page? What I really need is to run a c# code that is together the aspx page (code behind) to read a SQLite database and shows the result in a good interface (html-css-javascript).
Obs.: I have a assembly reference for the SQLite.
Thanks a lot!
You need to create an application page inside sharepoint and move your code in that application page. its very simple, please see this link.
http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-create-custom-sharepoint-2010-application-page-using-visual-studio-2010/
Please note that application page only support web forms and not MVC
Not sure "run it into a sharepoint folder" means... You can't have page with code behind in regular SharePoint folders.
You can put ASPX pages (even with codebehind) in Layouts folder on server's disk and they will be avaiable with ....\layouts\your_page.aspx urls.

how to add C# code in default.aspx in SharePoint

I am using SharePiont Server 2007 Enterprise with Windows Server 2008 Enterprise. I am developing using VSTS 2008 + C# + .Net 3.5. I want to add some C# code to default.aspx (more details, adding some logics to Page_Load method of default.aspx) and its code behind file. But I did not find default.aspx and its code behind file on disk? Where are they and how to modify?
BTW: another solution is to create a default.aspx file and its related code behind file by myself? But in this situation how to borrow the existing content/UI from current default.aspx (I am satisfied with current content/UI of default.aspx)?
I am not sure which solution is better and easier in my requirement to add C# code to Page_Load. Any advice or guides?
What kind of functionality are you trying to add and is this a publishing page or part of a standard WSS site?
EDIT
Check out Andrew Connell's article on MSDN :-)
http://msdn.microsoft.com/en-us/library/bb986729.aspx
Just a thought. How about creating a UI-less web part and adding it to the page ?

Categories