I'm working on an application (ASP.NET, Webforms) that generates a list of outputs based on a user input. I want to allow the user to save the contents of said list as text file, or possibly as other filetypes such as .csv. What is the best way to approach this? Can it be done client-side with Javascript?
As an extensibility option for my web application I would like to allow the user to add sections to it by simply making new folders and uploading files to them. So, for instance, if they created (in the webroot): /UserContent/StaticPages/First/Second/index.txt. Then in the main menu there would be a new menu point "First" with the submenu point "Second", which would lead to markdown-parsed version of index.txt. This way the user can upload any static menu points he wants (such as "About us", "Contact us", "Our Mission" etc.) Another extensibility point is that I would like them to add headers/footers to specific webpages in a similar fashion. I'm using ASP.NET MVC3, so there are pretty URLs, and it would be easy for the user to just create: /UserContent/Additions/Store/Categories/35/header.txt
And when someone opened [URL] the markdown-parsed header.txt would be prepended. This is simple for the user, and simple for me (I don't need to make sophisticated admin panels and WYSIWYG editors). However I'm worried about the performance. This scheme means that on each GET request I would need to scan the /UserContent/StaticPages folder and check for the existences of the header/footer files (several, because parent levels can have their header.txt/footer.txt as well).
I could cache the result, but then I have to manage the cache and the user will need to know that changes can take up to X minutes to display. Would this be a premature optimization? There won't be much data in those folders, so Windows will probably be able to easily cache their contents itself.
im using Visual Web Developer Express2005 and language: VB
Example Image of my forum thread that im working:
i encircled in color red the part where i assign the 'content' as you can see above.here EXAMPLE of code in my repeater that populate a <td>(inserting data FROM my database) from my TableField('content')
[Code]....
the part that i encircled in the image above was the data on my tableField named--> 'content'.
The idea was to show not the whole content but to show Only some part of it. example is to show only the 1st 300chars or 100 words.
i tried this code which shows the fist 1-100 chars. [Code]....
Problem is the data i stored in the TableField('content') has other html tagsExample my Tablefield('content') has the following data.
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="mso-ansi-language: EN-CA"><span style="font-size: x-small">All hands worked in the preparation..............
When i use the code .tostring.tosubstring(1, 100) it shows: <p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="mso-ansi-language: EN-CA"><span style="font-size: x-small">All hands worked in the preparation..................
instead of starting at: All hands worked in the preparation.......Is there a way that i could extract first the html tags then use the .string.tosubstring(1, 100) to make it work.I use the code below temporarily to generate the 'content' as showed in the image above. i limit the height of the lable to 100px which does the trick. but i know its not a good method thats why im trying to look for other methods.
With the ajax file uploader, would it be possible to check the size of the image before uploading?Currently, it uploads the file to the server and then lets me know that it's bigger than the limit size.
I'm trying to make a .Net, c# application for online creating surveys. I have a few types of questions, and than I dynamicly put labels, combos, textboxes ... on the form. Up to this point, I somehow managed to get. Than, on click on add button, I write down the responses in html format using stringBuffer and append function. Example.
public string RetOptionalQuestion(string seq_numm, string question, string answersOpt) { StringBuilder _output = new StringBuilder();
I'm trying to write the contents of a TextBox to a file but can't seem to find the right method. Whats wrong with this code?
Dim FileName As HtmlGenericControl = TryCast(DetailsView1.FindControl("TextBox2"), HtmlGenericControl) Dim newFilePath As String = Server.MapPath("/myXML/" + FileName.InnerHtml)
If I replace FileName.InnerHtml with "myXML.xml" it works.
How can this be done? The .InnerText Property (when used on the containing div element) is giving me the html only. Is it possible to iterate through all the li elements contained and extract their values?
I'm using a FCKEditor. I added some word document files in the server. I need to read the content of the work document in HTML format and assign it to the FCKEditor.
I have an HTML Editor in a modal popup triggered by a link on a detail page. The Editor can be used multile times in the same session. If a user adds content and then saves it all is ok. If he the selects to add more content the text from the previous attempt appears in the editor.
NOTE: I know I could iterate through parent div's child controls in codebehind (although I would need to make them all "run at server", or even parse the InnerHtml property of the parent div), but if feels pretty weird.
Also, I am aware that if the article was being created from a data source, I would have the content already organized, but I would like to make as little changes needed in the existing pages.
i want to get the contents of a textbox and set them to a asp label for output, we can cause a postback to if that makes it easier, so far i did this and it comes up trumps
I have a ASP.Net website with links to files stored on a file server. These files are modified constantly and so the links will not always be valid, this includes changes to permissions, files being moved or deleted, etc. I implemented a method in the code-behind to check the validity of these links as they are constructed, if it fails the code will add CSS to change the color of link:
Check URL
/// <summary> /// Check if a URL exists. Method by http://www.vcskicks.com/check-website.php /// </summary> /// <param name="url">URL to validate</param> /// <returns>True if the URL was resolved, false otherwise</returns>
[Code]....
My problem is that not all the invalid links are getting the style added to them. The strange thing is that when I step through the method in debug mode using one of the bad links that was not colored, the method will return false and color the link as expected. There's a lot more involved then what I present above, but I searched the entire aspx code-behind for any other locations where the link url is being set and couldn't find any. I don't know if there's some post processing going on that somehow clears any styles that were applied to some of the links. The fact that some links are colored while others are not is very confusing to me. Has anyone else encountered similar behavior before?
I've created a seperate html files for navigation, content and footer. I want to club those files. All the navigation, content, footer files resides in the same directory where the index.html file resides. I want to include the above mentioned html files inside the index.html. I have tried using the following in index.html file <!-- #include virtual="topbanner.html" -->
I also tried using the asp code which also fails. I tried with asp by changing all the html file extensions as .asp. Then i tried to place the following asp code in index.asp file as <!-- #include file="topbanner.asp" -->
I have installed an HttpModule into my web app that will handle all requests with a given file extension.
I want ASP.NET to handle all requests with the extension, regardless of whether there is an underlying file on disk. So, when I added the extension to the 'Application Extension Mappings', I unchecked the 'Verify that file exists' checkbox.
However, this just transfers the file check to ASP.NET rather IIS, so I just get a different error page when requesting URLs with the file extension.
Is there a way to preempt this ASP.NET file checking and intercept the requests?
how can i load the contents of an xml file at a url into a string? eg there is an xml file at [URL] I want the text of the xml to be assigned to a string. How can i do that using c#?