DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

aquinas Subscribe to this feed
aquinas
Profile Kicked Submitted Comments Tags Friends Kicked By Friends Submitted By Friends


Comments:

I don't think "as" is faster.
posted by aquinas 17 days, 2 hours ago

"All MVC frameworks (not just the .NET ones) give you complete control over the HTML."

Because you have to write all the HTML yourself, correct? You can write all the HTML yourself in ASP.NET, just don't use any controls. Like you said: repeater works wonders. For many applications, you may need to do a lot of that. Depends on what you're doing.

"I found some things are just broken. I still have a site in production, with a single TextBox and asp:Button that will not work if you hit "Enter" in the TextBox."

For the case you mentioned you need to add defaultbutton="your button" to the form. This only is an issue with IE actually. Also, no offense but did you actually google this problem? e.g., google: "single textbox button submit onclick asp.net".

What else is broken?
posted by aquinas 1 month, 15 days ago

# The ridiculous amount of time I spend in Reflector trying to figure out why things that are supposed to "just work" when wired up "just don't"

I don't think I've ever had to use reflector to figure out why something in asp.net isn't working. Really? You're CONSTANTLY in reflector? I find that hard to believe.

# Not having control over the HTML that is spit out.

HTML that is rendered by server controls you mean? Does MonoRail give you control magically over server control output, or do you just not USE server controls when using monorail? Either write your own controls or you could use control adapters.

Trying to do anything with AJAX or DHTML with the insane control names controlName.ClientID anyone?

Whatever.
posted by aquinas 1 month, 15 days ago

Sheesh people are being pretty freaking harsh. Has anyone actually tried using EF yet?
posted by aquinas 1 month, 16 days ago

I'm going back to sleep
posted by aquinas 1 month, 28 days ago

Why is the password stored in plain text?
posted by aquinas 2 months, 22 days ago

Yeah, I've never been a big fan of aliases myself. When reading the code you have classnames in your code that don't actually exist. Maybe it's just me but I find that a bit confusing.
posted by aquinas 3 months, 5 days ago

How about you change the functions so that they return the builder. Then you could do this:
TableBuilder tb = new TableBuilder();
tb.AddHeaderRow("Col 1", "Col2", "Col 3")
.AddRow("col 1", "col 2", "col 3")
.AddRow("col 1a", "col 2a", "col 3a");

Just a thought
posted by aquinas 3 months, 10 days ago

Well, you stated that "There is more overhead associated with HTMTextWriter." That's why I included the timings, so that those who might wish to use your code were aware that their did not appear to be any significant overhead as far as time goes. If you meant some other overhead besides time, then sorry, my bad.
posted by aquinas 3 months, 26 days ago

try this:

System.Diagnostics.Stopwatch stopw = new System.Diagnostics.Stopwatch();
stopw.Start();

for (int i = 0; i < 1000; i++) {
System.Text.StringBuilder sb = new StringBuilder();
List<ElementAttribute> attributes = new List<ElementAttribute>();
attributes.Clear();
attributes.Add(new ElementAttribute(HTMLHelper.ID, "gallery"));
//attributes.Add(new ElementAttribute(HTMLHelper.CLASS, "\" <hello>blah</hello>"));
attributes.Add(new ElementAttribute(HTMLHelper.CLASS, "whatever"));
attributes.Add(new ElementAttribute("onclick", "whatever()"));

for (int j = 0; j < 1000; j++) {
sb.Append(HTMLHelper.BeginDiv(attributes));
sb.Append("blah");
sb.Append(HTMLHelper.EndDiv());
}
}

stopw.Stop();
Console.WriteLine(stopw.ElapsedMilliseconds);


stopw.Reset();
stopw.Start();
for (int i = 0; i < 1000; i++) {
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter writer = new HtmlTextWriter(sw);

for (int j = 0; j < 1000; j++) {
writer.AddAttribute(HtmlTextWriterAttribute.Id, "gallery");
//writer.AddAttribute(HtmlTextWriterAttribute.Class, "\" <hello>blah</hello>");
writer.AddAttribute(HtmlTextWriterAttribute.Class, "whatever");
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "whatever()");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
writer.Write("blah");
writer.RenderEndTag();
//string tstring = sw.GetStringBuilder().ToString();
}
}

stopw.Stop();
Console.WriteLine(stopw.ElapsedMilliseconds);

Console.ReadLine();

On my machine the version that uses HtmlTextWriter is about 300 milliseconds FASTER. If you uncomment out the lines that are commented out, it's about 100 ms slower. The reason why it's slower is because it properly esacapes HTML entities, which the HTMLHelperClass does not. That's what [)amien was referring to when he said your version is open to HTML injection.

I'm not trying to rail against you. I just take exception with your comment of "After reading these comments I am realizing that it is the tendency of most developers to over-complicate almost everything." It just seems a bit odd that you're saying people over complicate things, when there is an existing class that does what your class does, but you've invented your own. AND you have to tell people that use it to be careful because you need to do your own html escaping.
posted by aquinas 3 months, 26 days ago

Why not HtmlTextWriter?
posted by aquinas 3 months, 27 days ago

Microsoft's website doesn't say anything...
posted by aquinas 7 months, 17 days ago

Regarding making a round trip to the database: what kind of database would one be using that doesn't support identity fields or sequences that you have to make a round trip to the database to get the next id? Please tell me you're not doing a select max(id)+1 from table. Hello race conditions.

"Reason 3: Type/Table Ignorance" Yeah, now you also don't get any foreign key constraints / cascading deletes on your "ParentGUID".
posted by aquinas 8 months ago

Movember! Mo Visual Studio!
posted by aquinas 8 months, 1 day ago

? Regions == Evil
False

Maybe he meant to assign Evil to Regions, rather than comparing them? =)
posted by aquinas 8 months, 5 days ago
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge