.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to change the content of an html file using an aspx file?

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net

Hi everyone,

I would really like to have a little help, it should be easy but i can't find the answer

and it's been a while since iv'e done something with asp.net..

what i have now is a regular html pages website.

in some of the pages i have galleries,

I would like to make an aspx page to manage the content of the galleries or any other set-in advance content.

It's kind of a CMS, but it's not, since i would not be using a database.

what i want is just to get the admin's content from the aspx page

and send it to overwrite the images or the content of the DIVS in the html page.

at the final outcome, i will only want to have html files and one aspx file for the admin's editing use.

what is the most simple way to do that without using CMS? 

Thanks a bunch!


View Complete Post

More Related Resource Links

Linking JS file to ASPX page or content page

Hi, I moved my JS functions into an external file "JScript.js", because I'm now using a master page and a content page.But it doesn't work any more, and I can't find why.I tried simply to link a js file to an ASPX file, by adding to the script manager the path of my script, but it doesn't work.Here is my js file (we don't need any special things in it do we?) var step1 = false; function pageLoad() { var accCtrl = $find('AccordionCtrl_AccordionExtender'); accCtrl.add_selectedIndexChanged(onAccordionPaneChanged); } function hideAccordionPane(paneNo) { ... } function changeSelected(idx) { ... } function onAccordionPaneChanged(sender, eventArgs) { ... } function check() { ... }And here is my ASP code: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0

How to change the split view when editing an aspx file

I've been using SPD 2010 more and more over the past few weeks.  However, when there's a navigation bar on the left, toolbox on the right, ribbon above and split view of code and design in the middle, there's just not enough room on the screen - (I have 2 LCDs at 1280x1024).  I can spread the window accross both monitors but that's not much use unless, I can change the split between code and design from horizontal to vertical. Is this possible?  Help apprieciated. Cheers, Bill

HTML comments in ASPX file causes exception


Hi, I'm new to ASP.NET MVC 2 but I've done webforms programming. In my first MVC2 test project in VS 2010 I got an error that surprised me. Code inside HTML comment tags are obviously parsed and sometimes even causes exceptions. This seems to me like a strange break with a programming paradigm that is as old as programming itself.

The code section in question is a form inside a user control.

Code that runs OK:

   <% using (Html.BeginForm("Index", "Search")) {%>
            <input id="SearchText" name="SearchText" type="text" />
            <input type="submit" value="Search..." />
    <% } %>

Code that causes YSOD:

   <% using (Html.BeginForm("Index", "Search")) {%>
            <!--<asp:TextBox ID="AccountText" runat="server" Width="226px"></asp:TextBox>-->
            <input id="SearchText" name="SearchText" type="text" />
            <input type="submit" value="Search..." />
    <% } %>

The error message given is Control 'c

Launch CMD File From ASPX Page


My organization uses a CMD file to install updated files for a major enterprise application. Currently, we send out an email to users with a link to the file and instructions to run it, BUT inevitably users don't update their machines until their in field and try to start the app.


We're now liking the idea of using an ASPX page to prompt the users to run the updates and to capture the fact that the updates have been run. I realize that we can't capture the success or failure of the update. But we'd like to capture the user accessed the page.


Is it possible to embed into the markup for the page a link to the file on the local intranet that the users can click on to run the file?

The user accessing the page would capture that they did just that. We'd deal with wether or not the update was actually installed or if it failed later with them directly.

>>>How to use javascript function in aspx file?



I have a file util.js and there some funtions in same file.

For example functions name are keyUp, keyDown, isNumeric, isAlphaNumeric

I have used these functions in aspx code behind in a textbox to restrict user that he may not be able to input any special character.

Before, I used the code directly in aspx file but I have do it for different textboxes therefore to avoid much coding in aspx file I created util.js and put all code in this file but how to use these particular functions in aspx file I couldn't find the way.

Anyone have idea. Do share with me.

I used the reference like this:


' Font-Names="Verdana" Font-Size="8pt" Onkeyup= "keyUp(event.keyCode)" Onkeydown="return isAlphaNumeric(event.keyCode);" onpaste="return false;">

Calling parameterized method from aspx file


Hi all,
I have following method
 public string GetYoutubeVideo (string code)
        return "asasdasfa"

Writing the windows forms data to an HTML file

I have a windows forms application ready now i need to transfer data from the windows forms to the web and to do this i need to write an HTML file that contains the form data, i mean the data contained in the form should be written to an HTML file to be submitted and this HTML file should be generated on the local PC. I have the code for the HTML file but how can i write this HTML file with the data values contained in my windows forms. Please give your suggestions. Best Regards, Syed

How to change this code to allow more file uploads

I have a page currently setup to upload 1 image at a time, it uploaded the image, then creates a thumbnail for that image in the same directory. Client needs / wants to be able to upload a few more images at the same time. So i would like to see if i can use the existing code that works, but setup to upload a few more images and process them all to create the thumbnails. I currently have a page that allows them to upload 5 images at a time and that works fine, but its just simple uploading the images, nothing else is happening at that moment. Here is the code i am working with: protected void UploadBtn_Click(Object sender, EventArgs e) { String pth = Server.MapPath("~/gallery/homebirth/images/"); String UploadedFile = MyFile.PostedFile.FileName; int ExtractPos = UploadedFile.LastIndexOf("/") + 1; //to retrieve only Filename from the complete path String UploadedFileName = UploadedFile.Substring(ExtractPos, UploadedFile.Length - ExtractPos); // Display information about posted file. Div is invisible by default FileName.InnerHtml = UploadedFileName; MyContentType.InnerHtml = MyFile.PostedFile.ContentType; ContentLength.InnerHtml = MyFile.PostedFile.ContentLength.ToString(); //div is made visible FileDetails.Visible = true; // Save up

Read an XML file, setting uname/pw, Accept, Content-Type

Hi; To read some REST XML data we need to set the username, password, and tell it for the http request Accept: application/xml Content-Type: application/xml Is there a sample anywhere showing how to do this? thanks - daveVery funny video - Reporting as a Metaphor

Change workflow rule file

Hi, I create workflow and rule base condition for that ".rule file"  . But now i have to change rule condition . when i change the condition then it return error can't  validate because of it refer previous values.   Any one can tell how change rule base conditions in workflow.

Should time date stamp on .Asmx file change when project is rebuilt?

I have a web service project. The web service is named Recalc.asmx and it has a code behind file namedRecalc.asmx.vb Now if I make a change to my web service .vb code and then recompile the project, should my Recalc.asmx filebe updated as well? In windows explorer I see that the time date stamp of my Racalc.asmx.vb file changes to the date of the last change.But the time date stamp of the Recalc.asmx file does not change? Why is that? My original thinking was that I would simply need to copy the Recalc.asmx file to the test server. But the date stillshows it's original creation date of 7/1/2010 and not the date of the last rebuild as I was hoping it would do?

ASP.Net - App Pool restarts because of file change notification

Hi All,IIS restarts everytime i delete a file. I came across this code which was supposed to fic the problem but the line f.GetValue(..) in last but one line returns null. Can anyone tell me why this is happening -//FIX disable AppDomain restart when deleting subdirectory//This code will turn off monitoring from the root website directory.//Monitoring of Bin, App_Themes and other folders will still be operational, so updated DLLs will still auto deploy.System.Reflection.PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);object o = p.GetValue(null, null);System.Reflection.FieldInfo f = o.GetType().GetField("_dirMonSubdirs", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.IgnoreCase);object monitor = f.GetValue(o);System.Reflection.MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); m.Invoke(monitor, new object[] { });

How to add link to a css file in content page?

How to add link to a css file in content page? There is no Head tag.

Changes in the values of controls of .cs file not reflecting on .aspx webpage while execution.

In my code I am assigning certain values to labels from data reader.While debugging I can see that proper values are assigned but the changes are not reflecting in the end of debug on the webpage that are executing.// My Code// Question.aspx.csusing System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class Examinee_Question : System.Web.UI.Page{    ExamFunctions ef = new ExamFunctions();    SqlConnection con,con1;    SqlCommand cmd,cmd1;    SqlDataReader dr,dr1;    String QType="";    int ctr = 1;    protected void Page_Init(object sender, EventArgs e)    {        con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Db.mdf;Integrated Security=True;User Instance=True");        con.Open();        con1 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Db.mdf;Integrated Security=True;User Instance=True&qu

Access Javascript from an aspx file through another aspx file

Hello, So.. I have a file called myFile.aspx which is linked to a js file called myJS.js    There is a file linked to an entirely different frame called theOtherFile.aspx.  I want to access a function is myJS.js called myFunc in theOtherFile.aspxI am not entirely sure how I would accomplish that..I am quite new to MVC2 and JS, so I am quite confused as to how to do this.  Any suggestions would be much appreciated.~Anath

Write html file through webservice

I am writing an application in which I want to generate dynamic html file based on the parameters of jquery objects. I want to pass the parameters to a webservice which will produce the required html page. How I can achieve it. Is there any other good approach to this problem.

Crwaling Network file shares and HTML Sites

Hi, Recently we have enabled Incremental crawling.Now our customer requirement is they are expecting search to crawl Network files,HTML sites.Should we change any settings in the Search.Please let us know Thanks & Regards, Sudheer
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend