Jump to content
Xtreme .Net Talk

travisowens

Avatar/Signature
  • Posts

    109
  • Joined

  • Last visited

About travisowens

  • Birthday 07/04/1976

Personal Information

  • Occupation
    Developer / System Architect
  • Visual Studio .NET Version
    VS.Net 2003
  • .NET Preferred Language
    C#

travisowens's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Keep in mind, datareader's increase in speed also means it has reduced functionality, but if you don't need certain features you get from a dataset, then no loss. As far as speed, fastest to slowest: 1. ram 2. database server (even if it's running on a separate box) 3. xml file Keep in mind, storing a XML file and reading it into ram is slow that querying the database, because you have to do #3 and then do #1. I once benchmark compared a system I wrote (before .NET) that would read .HTML templates off the harddrive, and when I put the HTML text inside a database table, I could read the database 8x faster than a .HTML file off the HD. Of course 8x faster than microscopic is still microscopic, I didn't use the "template in a database" code because it was seriously more complex to alter a template inside a column vs simply editing a .HTML file on the drive. It would only be an acceptable trade-off when you're dealing with millions of hits (Amazon, eBay). As a beginner, don't always go the fastest route, keep things good and flexible, don't forget the KISS rule. Also, if you read into Yahoo's research, only 5% of the total time it takes a webpage to draw is spent on your server code, the other 95% is spent on parsing your HTML/JS/CSS so spend your time outputting great HTML if you want speed improvements. Explaining that is far beyond the scope of this thread.
  2. The following syntax is legit but it then the button no longer goes anywhere. <button><a href="?action=go">GO</a></button>
  3. I have a page where I have <button> tags and I simply wrap them inside <a href> but TIDY says this is not legit. What's the correct way to do the following: <a href="?action=go"><button>GO</button></a> The W3C doesn't mention anything either: http://www.w3schools.com/tags/tag_button.asp Technically, the traditional way to do this, which works fine but is very verbose is: <form style="display: inline;"><input type="hidden" name="action" value="go"><input type="submit"></form> but as you have more GET values to push, this gets very long (I already have 3 in my real code). I'm just looking for a cleaner & more elegant way to achieve this.
  4. You need to use a WinForm as otherwise you'd have to write a custom ActiveX app to do the file management, which IE7 will pretty much push the user not to install. Also, since you want this to run at logon time ("authenticate a User during logon") then you'll also want it a WinForm as you can put the .EXE in their startup, which will be much neater than trying to push a web url to the user, which can not function correctly if the user changes their default browser.
  5. IN a dynamically (via SQL) generated survey I need to enforce a minimum on some checkbox questions. So let's say I have 10 colors and you need to "pick at least 2". Let's assume I have 3 of these questions in my survey. Ideally, I would like the submit button onclick fire off an alert to tell the user that questions 1, 2, 3 need addressing if they don't have the minimum. I already have a CSS class that toggles to give a visual cue that the question isn't valid, but now I need to actually enforce it. (PS: server side isn't important now) The only way I can think of doing this is to create a 3x4 array that contains (question#, checkbox name, number of checkboxes, min) .... which would look like (1, 'chkColor_', 10, 2). The function would take each row of the array, loop thourgh all the IDs (via 'chkColor' + for 0 to 9) and if the min isn't met, fire an alert that says "question "+ question + " requires at least "+ min +" choices." Is there a more efficient way to do this then sending a 3x4 array?
  6. RESOLVED It seems VS2005 does have decent RegEx support, but it uses it's own syntax. Silly me for not clicking the arrow next to the textbox to see it. You can also read up about it at: http://www.codinghorror.com/blog/archives/000633.html
  7. I wouldn't have questioned this at all if I had seen a more formal syntax, such as if(x) { with(x) { style.setExpression('left',document.body.clientWidth-60) } } I'm outright shocked that with() works outside the brackets.
  8. . ...........RESOLVED (see next post) . I'm looking into somebody's Javascript code and I came across this syntax, I have no idea what the if/with line means and Google isn't helping. BTW, this is part of a web control that puts a HELP link on the top right of pages. <div id="HelpTopRight" class="HelpTopRight" style="white-space:nowrap;"> <xsp:HelpLink ID="lnk" runat="server" /> </div> <script type="text/javascript" language="javascript"> var x=document.getElementById('HelpTopRight') [b]if(x)with(x)[/b] { style.setExpression('left',document.body.clientWidth-60) } </script>
  9. Call me a nit picker but I would assign "head" to a variable outside the look and reference to it, preferably at the beginning of your method. I hate to absolutely hardcode something like that inside a loop, especially when the loop is much larger, you never know when you'll need to change it and imho defining the target string is best put at the top of the method.
  10. Too bad the RegularExpression objects don't have their own Split, you could probably write a pretty flexible split based on regex.
  11. I don't think you're going to be truly happy with scaling unless you use WPF (Windows Presentation Foundation) which is a Vista only thing (and soon to be XP too) and will require VS2005 or VS2007. Otherwise, just anchor your controls properly and deal with the minor consequences.
  12. PS: ignore all quotes, just there to wrap up the regex, also this forum trims spaces so I've said 4 spaces instead of typing them. Does VS2005's search & replace lack full RegEx support (ala .Net's)? I'm trying to safely convert the 4 space indents to tabs, and want to do this safely. Meaning I don't want to simply convert "4 spaces" to "\t" just in case some string or other (non indenting) spacing exists. I tried the following RegExs and VS2005 didn't like them, what am I doing wrong? ^( ){1,} ^(\s{4}){1,}Anybody reading this should read those as 4 spaces, in sets of 1 or more that start at the beginning of the line. The only thing I can get to work in VS2005 is "^4 spaces". I cannot do sets or use \s, what gives?!
  13. Resolved... I simply needed to use RepeatDirection="Horizontal" I have a RadioButtonList and even when I do RepeatLayout="Flow" it's output <br> tags that I can't override with Display: inline; <asp:RadioButtonList ID="DistanceBW" runat="server" CssClass="RadioGrid" RepeatLayout="Flow"> <asp:ListItem Value="20ft" Text="" /> <asp:ListItem Value="21ft to 40ft" Text="" /> <asp:ListItem Value="41ft to 60ft" Text="" /> </asp:RadioButtonList> which outputs <span id="ctl00_Content_DistanceBW" class="RadioGrid"> <input id="ctl00_Content_DistanceBW_0" type="radio" name="ctl00$Content$DistanceBW" value="20ft" /><br /> <input id="ctl00_Content_DistanceBW_1" type="radio" name="ctl00$Content$DistanceBW" value="21ft to 40ft" /><br /> <input id="ctl00_Content_DistanceBW_2" type="radio" name="ctl00$Content$DistanceBW" value="41ft to 60ft" /> </span> How can I get these radio buttons to align side by side?
  14. Looks like I should have googled harder before posting... All I had to do was add RepeatLayout="Flow" to the <asp:RadioButtonList tag
  15. RESOLVED... see the following post I have the following markup <asp:RadioButtonList ID="DistanceBW" runat="server" CssClass="RadioGrid"> <asp:ListItem Value="20ft" Text="" /> <asp:ListItem Value="21ft to 40ft" Text="" /> <asp:ListItem Value="41ft to 60ft" Text="" /> <asp:ListItem Value="61ft to 99ft" Text="" /> <asp:ListItem Value="100ft" Text="" /> <asp:ListItem Value="NA" Text="" /> </asp:RadioButtonList> which outputs <table id="ctl00_Content_ImageDistance" class="RadioGrid" border="0"> <tr> <td><input id="ctl00_Content_ImageDistance_0" type="radio" name="ctl00$Content$ImageDistance" value="20ft" /></td> </tr><tr> <td><input id="ctl00_Content_ImageDistance_1" type="radio" name="ctl00$Content$ImageDistance" value="21ft to 40ft" /></td> </tr><tr> <td><input id="ctl00_Content_ImageDistance_2" type="radio" name="ctl00$Content$ImageDistance" value="41ft to 60ft" /></td> </tr><tr> <td><input id="ctl00_Content_ImageDistance_3" type="radio" name="ctl00$Content$ImageDistance" value="61ft to 99ft" /></td> </tr><tr> <td><input id="ctl00_Content_ImageDistance_4" type="radio" name="ctl00$Content$ImageDistance" value="100ft" /></td> </tr><tr> <td><input id="ctl00_Content_ImageDistance_5" type="radio" name="ctl00$Content$ImageDistance" value="NA" /></td> </tr> </table> I want all these checkboxes next to each other (it's going to be part of a table, made up in CSS) but how can I prevent ASP.Net from putting these in seperate <tr>'s?
×
×
  • Create New...