the alligator tags <% %> are Not being highlighted, and when I run I get the following error in the yellow screen:the controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
i have created a aspx page with the script manager, update panels and so on. Now, when i use some jquery functions which are included inside the head tags, when the page is run, i find the script tags generated inside the body instead of the head tag. i'm using visual studio 2005 only.
I have a SharePoint web part that I wrote in C# which is used to display SQL Server data based on user selections. I pull the data with a DataReader, fill a DataSet with it, and set that DataSet as the DataSource in a GridView and add that control to my page:
This gives me a simple HTML table with a declared CSS class and that's about it. The only problem I'm facing is that line breaks in the data fields are not being rendered at all. I'm simply getting a block of text that ignores the breaks that are present in the database when it's rendered to HTML. In stepping through my code, I see that the newlines are coming in as text in the form of "". I tried a regex:
I have to set image on the basis of fields value coming from db. I want it to achieve via. tags <%# %>. For example i have collection binded with grid. It has a Field called Online which is boolean. So if the value of Online is true then the green.png will be set as path of asp:image control else grey.png will be the path of the asp: image control.
I need to be able to remove non-XHTML tags from a string containing XHTML that has been stored in a database. The string also contains references for controls (e.g. ) inside the XHTML, but I need clean XHTML with all standard tag contents unchanged.
These control tags are varied (they could be any ASP.NET control), so there are too many to go looking for each one and remove them. The way they are closed is also varied, so not all of them have closing tags, some are self closing.
How can I go about doing this? I've found some HTML cleaners on-line for including in my project, but they either remove everything or just HTML encode the entire string.
Also, I'm dealing with parts of XHTML documents, not entire documents - don't know if that makes a difference.
An example (not fantastic, but gives you the idea of what I'm working with):
<p><mycontrols:mycontrol myproperty="hello world" myproperty2="7"><SPAN><a href="#"><img title="an example image" height="68" width="180" alt="an example image" src="images/example1.gif"></a></span></mycontrols:mycontrol><a href="#"></a></p>
I have a large string of HTML that I have parsed with a bunch of already formed links in it. I am looking for a quick way to get rid of all of the links to display just the text. Any help or suggestions is appreciated!
I have a long string containing the ,<p> </p> and <br>. I want to clean my string from all these tags and spaces. How it can be done with String.Replace() method. I am doing separately right now, it is working but is there a way to do it at once, without replace() method.
I am building a forum and I want to use forum-style tags to let the users format their posts in a limited fashion.Currently I am using Regex to do this.As per this question:How to use C# regular expressions to emulate forum tags. The problem with this,is that the regex does not distinguish between nested tags.Here is a sample of how I implemented this method:
public static string MyExtensionMethod(this string text){return TransformTags(text);} private static string TransformTags(string input) {string regex = @"[([^=]+)[=x22']*(S*?)['x22]*](.+?)[/(1)]"; MatchCollection matches = new Regex(regex).Matches(input); for (int i = 0; i < matches.Count; i++) var tag = matches[i].Groups[1].Value; var optionalValue = matches[i].Groups[2].Value; var content = matches[i].Groups[3].Value; Now,if I submit something like [quote] This user posted [quote] blah [/quote] [/quote] it does not properly detect the nested quote.Instead it takes the first opening quote tag and puts it with the first closing quote tag.Do you guys recommend any solutions?Can the regex be modified to grab nested tags?Maybe I shouldn't use regex for this?
I have to break a HTML content string in to multiple lines. And each line should have some fixed characters, 50 or 60 Also I don't want to break the word..or html tags...
ex : <p>Email: <a href="mailto:someone@gmail.com">someone@gmail.com</a></p> <p><em>"Text goes <font color=red>Hello world</font> Text goes here and Text goes here Text goes here 1976."</em> </p>
Is there a way to apply your own CSS tags to <li> tags when using ASP .NET 4.0 menu control? For example, say I have an external style sheet that has tags "class1", "class2", "class3", and etc. I want to apply "class1" to the first menu item. Then if menu item is selected, I want to apply "class2" and if it's not selected, "class3". I played with various 'Static' styles, but just can't get it work. I finally gave up and created my own menu control that extends ASP .NET menu control and provides my own custom rendering. This works, but I'm wondering if there is a way to get it work with built-in menu control.
string title = string.empty; My need is that whatever string is passed to it I have to display the content inside a div with in a doublequotes .So I have written something like:
<div>"+ title +@"</div>
But how to add the doublequotes here? So that it will display like :
im using asp.net and somehow my escape characters dont seem to work
string testing = "my name is "abc"";
this gives the output : my name is "abc"
ive read all the tutorials, everywhere it says that ive to put " to use double quotes inside a string but i have no idea why my system isnt accepting the escape character.
i'm doing ajax website using PostWebRequest() function, when i call any .aspx page to the target html element the output is coming fine in IE but in FF(FireFox) is coming in html format(html tags) IE output : [URL] FF output : [URL]
javascript functions : function PostWebRequest(postPage, HTMLTarget, parameter) { displayElement = $get(HTMLTarget); displayElement.innerHTML = "<div style='text-align:center;'><br /><br /><br /><br /><br /><img src='images/ajax-loader.gif' algin='center' /></div>"; var wRequest = new Sys.Net.WebRequest(); wRequest.set_url(postPage); wRequest.set_httpVerb("POST"); var body = parameter; wRequest.set_body(body); wRequest.get_headers()["Content-Length"] = body.length; wRequest.add_completed(onWebRequestCompleted); wRequest.invoke(); } function onWebRequestCompleted(executor, eventArgs) { if (executor.get_responseAvailable()) { if (document.all) { displayElement.innerHTML = executor.get_responseData(); } else { displayElement.textContent = executor.get_responseData(); } } else { if (executor.get_timeOut()) { alert("Timed Out"); } else { if (executor.get_aborted()) alert("Aborted"); } } }
I am developing a application in C#, ASP.NET and I have a lot os divs in my page, each div is a container for a chat message and each div have a unique id: like this
I am developing a web application that will allow the customer to enter a personalized message, which will then be converted to HTML. Well, the problem is that I can not allow the insertion of Javascript code. So I need a method that filters the text, searching for and remove it. I think the regular expressions to solve my problem, but I'm having difficulty building.