VS 2010 Remove All Gridview Html Junk/formatting?
Nov 19, 2010Why does the gridview put everything in a table?! Is there a way to not have the gridview generate any html what-so-ever and just use what I have in the ItemTemplate?
View 1 RepliesWhy does the gridview put everything in a table?! Is there a way to not have the gridview generate any html what-so-ever and just use what I have in the ItemTemplate?
View 1 RepliesI finally managed to export a gridview to an excel sheet.
Next, how can I remove the column width and alternatingrowstyle color (or all formatting if it is easier) "programatically" before exporting it to excel?
Demonstration of what I am trying to accomplish:
[Code]....
MVC is formatting my code horribly, and I was wondering if you can turn it off? I feel the answer is no, but I was hoping VS 2010 had built in a setting...Here's what its formatting as:
<% if (org.UserKey.HasValue)
{ %>
<%= org.Reference(i => i.UserReference).Email%>
<% }
else
[code]....
Quick VS2010 question.
I tried to apply formatting to my text (tools>options>texteditor>htmlformatting>tags)
where you can change color, style, and font-weight of certain tags, I apply them, but they do not change the text editor rendering of these tags.
Anyone else tried this with no effect?
Otherwise it works ok, but I find it easier to use one color for html, one for asp, and one for ajax tags for my purposes.
I want to put some kind of text editor on my website which allows the user to manipulate the formatting of text. I would also like it to be possible for a user to copy/paste text from an existing webpage and it keep the formatting i.e. markup tags, font weight, bullet points. I just dont know hoe to go about this but the information must be there as when you copy from a web page into ms Word it keeps the format.
View 8 RepliesUPDATE 2:
In this section, I am trying to manually add in tabs and line spaces so the string is formatted when displayed via the pre tag. But this does not work.
objStringBuilder.Append("<div>" & Environment.NewLine)
objStringBuilder.Append(vbTab & "<div>some text</div>" & Environment.NewLine)
objStringBuilder.Append("</div>" & Environment.NewLine)
Return "<pre>" & Server.HtmlEncode(objStringBuilder.ToString) & "</pre>"
UPDATE 1:
I have tried the following, but it does not work:
return "<pre>" & Server.HtmlEncode("<div><div>some text</div></div>") & "</pre>"
I want it to display something like this
<div>
<div>some text</div>
</div>
But it's diplaying like this, which is expected:
<div><div>some text</div></div>
I don't know how to get spaces, tabs, carriage returns into that string which are recognizable by the pre tag, as environment.newline and/or vbtab make no difference.
ORIGINAL QUESTION:
Is it possible to display HTML as text on your page in a formatted manner? For example, it should contain white spaces, tabs etc etc for readability purposes:
From another question, I have learned how to display HTML as text as follows:
Server.HtmlEncode("<div>Some text</div>");
I insert into asp.net mvc views C# logic that manages layout like the following:
[code]....
I try to minimize <% %> code placing "{" symbol on the same line as it's condition (java-style). Html layout looks more clear to me after that.
Do you apply C# formatting rules to <% %> html injections "}" should be on a new line or manage layout in different way?
I am currently writing a small templating system in ASP.NET to allow users to add content. For example, the user can enter the string (variable type is string).
topHeader[x] = "They think it's all over. It is now!";
However, one change that's needed is the ability to add some basic HTML tags within this content, so the following can be done
topHeader[x] = "They think it's all over. <strong>It is now!</strong>" or
topHeader[x] = "They think it's all over. <a title="Football News" href="URL">It is now!</a>";
If you add such things into strings now they are not formatted as HTML, but I want to somehow escape them so that they can be. Naturally I've looked on the Internet for the answer, but as Razor is fairly new there's not much out there to help me out.
I've looked around and can't find a solution for this and it's driving me mad.I've got a basic MVC2 app (C#) and am trying to display text from a database with the line breaks included. I've used the following:
<p><label>Description:</label>
<span class="fieldBlock"><%: Model.Description.Replace(System.Environment.NewLine, "<br />") %></span>
</p>
This is adding the tags to the returned string as I'd expect but when the page renders it actually displays the tag as is instead of rendering the newline. ie. the text seen by the user in the browser is:"Quisque justo erat, iaculis sit amet aliquam eu, porttitor in mauris.<br /><br />Maecenas nisi velit, euismod at molestie vitae, malesuada id turpis. Mauris diam nisl, pretium id molestie nec, posuere posuere neque.<br /><br />Cras sed lectus nisl."
I have a asp.net page that generates a report. For better or for worse, the entire thing is generated using nested tables. I am able to export the page to excel, however I lose all my formatting (can't set column widths, etc). Is there a way to handle this? I'm open to adding any goofy MS Office -specific tags that are required to the html side of it.
If this isn't feasible and if anyone has any other ideas, the requirement is that users need a report that:
a) They can manually touch up with some personalization / area-specific data
b) Needs to be hide/show columns based on user's location
c) Needs to run from the web site.
I have this razor code ...
Code:
<ul>
<li>
@("hello <i>world</i>")
</li>
<li>
hello <i>world</i>
</li>
</ul>
When I run it the italic attribute works on the second item, but not on the first. I'm guessing it doesn't work because it's being passed as a literal string and the html formatting is lost.
How can this be made to work?
The reason I ask is because in my project, the text for the list item is stored in a database and I want the ability to include formatting for the item at the database level.
Code:
@Html.Raw("hello <i>world</i>")
However, I am not getting the result I need, so here is a bit more code....
Code:
@helper addNodes(dcNode As DocumentContent)
@<li id=@dcNode.Id>
@dcNode.nodeTitle <--This results in "White Papers - <i>New</i>"
@Html.Raw(dcNode.nodeTitle) <--The truncates the string at the tag and results in "White Papers -"
@If dcNode.children.Count > 0 Then
@For Each childNode As DocumentContent In dcNode.children.Values
@<ul id=@dcNode.nodeTitle>@addNodes(childNode)</ul>
Next
End If
</li>
End Helper
This is a recursive helper that populates node for a jsTree and works fine, but the inline html is not working. Here is what the result looks like.
The text for each li is shown twice because I am showing it once without and once with HTML.RAW. Notice the "White Paper" item... the second text is truncate at the <i> tag.Why is this and how can I fix it?
I have content that I want to load dynamically, the problem is it has some html formatting in it. What control should i pull the text into, is there a way to pull the text into a div or a label, along with the formatting?
View 1 RepliesWe have a service that generates a report (using word templates and a 3rd party library), and then returns a string in HTML. While this HTML isn't great - its formatted correctly in this string. We want this HTML to show up on a page - format intact. What we currently have done is set an ASP.net Literal's text element to this string. While this works, I have noticed that it has reformatted the HTML string slightly. For the most part, it looks like it generated a bunch of new CSS classes, and a new style element in the HTML. This HTML does not exist in the string thats being returned. I could filter all of this back out, but wonder if there is a better way. I assume that the Page itself is altering something. What is the best way to display this raw HTML back to the user? I can't directly use a Response.Write(string), because this page does have a few other controls on it.
View 3 RepliesI tried to install Visual Studio Prof 2010 trail version in my system, but i got an error saying 'Please remove/uninstall Visual Studio 2010 load test controller' to proceed installation. i uninstalled my previous VS2008 software from system and i could not find anything like 'Remove/Uninstall Visual Studio 2010 load test controller' software in my Add/Remove Programs.
View 1 RepliesMy user filled a textbox with a text that was copied from Microsoft Word. This is a part of the text .
This system is - AUTOMATIC - and it is restricted
Look the symbols before and after the word AUTOMATIC. When I try to write this on a dynamically generated html page using the code bellow, i got this on the screen:
This system is â€" AUTOMATIC â€" and it is restricted
Code used to print the SQL Field:
[Code]....
The - symbol is not a minus symbol, but is a Word minus (-) symbol...
I am using C#.NET and ASP.NET
I want regex operation for removing style tags,css,scripts and html tags from html to plain text in asp.net c#...
View 1 RepliesBelow is the code to remove the URL bar on page load.... But I'm using AJAX with some panels and once the panels change, the URL comes back. Anyone experience this and know how to get around it?
Code:
<script type="text/javascript">
window.onload = function () {
setTimeout(function () { window.scrollTo(0, 1); }, 100);
}
</script>
when i write mockup in visual studio i found in intellesense that some tags like
asp:tagname but in mvc i don't want it. so are i can remove it then when i write mock up then i not see this webform tags in intellesense
I am currently finalizing an ASP.NET web application that requires to have a page printed at the end of the process.
Currently, what I am trying to achieve via ASP.NET is to NOT display the URL at the bottom of the printed page.
From my understanding, this is controlled by the web browser. On IE 8, you can go to file, page setup and you can remove the URL from the page footer.
My problem is this web application will be used by hundreds and I would have to manually change the settings for every user on their desktop. Also, another problem is that I still want the URL to be showed on the page footer when they print their other stuff on the web. And last, even if I go on every single computer and change the settings, well the user can put the URL back on the page footer.
So is there a way for my web application to control that ? I assume that there is a registry setting, but again i'm not sure my web application will have access to everyone registry due to strict policy on the network.
Another route would be to generate the letter in a PDF document but I don't want to go that route at this very moment..
I am sending mails thru SMTP server. If i use HTML body, then email is going to JUNK folder. If plain Text, then email going to Inbox. But I need to use HTML in body, without going email to JUNK. Any ideas?
I am sending this email from valid email address. i.e noreply@abc.com. abc is our company name. All other emails, which I get from this email address goes to Inbox only. But when i try to send mail it is going to JUNK, if body is HTML.
i am sending mails in asp.net via my hos eHostPros.but recepients receive main inside their junk folder.
View 4 RepliesWe have one Asp.net application developed using framework 2.0 with C#,Sql and AJAX. The application is running live from past 2 years almost. All the times users will be facing kind of strange problem, reporting some junk data will be displayed on the browser some times. When they refresh the page or reopen the browser, it will display the correct information.
For Eg. We have a stored procedure which returns months between 2 dates, if we pass 2 dates as '01/04/2010' and '30/06/2010' then procedure will return 'APR,MAY,JUN'.
Once case we have noticed where it has returned and displayed as MAY,JUN,JUL,AUG which is not possible. Once we refresh or reopen the page it displays the correct information.
This is one ex. whereas we have some other page also where we get unwanted values like that.
I am sending Email from SMTP server and all my Emails are landed in Junk in Hotmail ,Live and Yahoo. I am not using any Spam like content and following all the guildline to send Emails.
I check on mail to identify the Issues and found quite a few issues below
1) HELO Greeting Check
Description: Email Server HELO is . HELO greeting does not contain a valid domain. We would recommend to have a valid domain in HELO greeting. Ideally HELO greeting should be the same as Email server host name (in FQDN format).
2) BATV (Bounce Address Tag Validation) Check
Description: Email server is not using BATV format while sending out emails. BATV is recommended to ensure that your users do not become a victim of bounce floods.
3) DKIM (Domain Keys Identified Mail) Check
Description: Email does not contain any DKIM/Domain Keys Signature and the published Domain Keys policy rejects such unsigned emails. Therefore it is very likely that your emails are considered SPAM by Email servers verifying Domain keys. Signing your Outbound emails as per your Domain Keys policy will minimize chances of your Email being considered as SPAM.
I am trying to build a white list. I am using html agility pack to remove all tags I do not allow. however this only gets ride of these type of script tags
[Code]....
i'm using some components. When page render, components generate html comment tags. if i'm using this component 10 times on one page, html comments inserted 10 times.
How to remove html comment tag before render page?