Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

daniel__c

@daniel__c
About
Posts
11
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • HttpWebRequest in medium trust
    D daniel__c

    Hey All, I have an app that is requesting and scraping a static html page and have just realised that the machine that it is going to be hosted on is running the site under medium trust (which is not negotiable). So now i have a whole lot of scraping stuff happening, but can no longer make the http request without a security exception on the production server. The current code making the request is: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url); HttpWebResponse response; try{ response = (HttpWebResponse)request.GetResponse(); } catch(Exception ex){ throw new InvalidOperationException("Could not retrieve requested page.",ex); } ....then reading the stream in and putting into a string for use. Does anyone know of a way to make a request for a static html page on another site without running into security problems? Thanks

    ASP.NET html sysadmin security question

  • Html to Xml Conversion and viceversa
    D daniel__c

    You would need to download the project and check out some of the samples to confirm, but i believe that you can easily create an xml document from just a string (i.e. read the contents of your file into a string) containing html.

    ASP.NET html xml help tutorial

  • Html to Xml Conversion and viceversa
    D daniel__c

    You could try: http://www.codeplex.com/htmlagilitypack[^] There are some sample projects included, one of them will take a html page and return valid xml.

    ASP.NET html xml help tutorial

  • Foucs on a Text Box using javascript?
    D daniel__c

    Sorry, that should be document.getElementById('<%= .ClientID %>') not document.getElementById('<%= .ClientID %>') as originally posted. We usually do the .select() to select any text that is currently in the text box. You can do the focus alone, but the select tends to be a bit more user friendly.

    ASP.NET question javascript

  • Foucs on a Text Box using javascript?
    D daniel__c

    We usually do something like this: function LoadFocus(){ document.getElementById('<%= <TextBoxName>.ClientID %>').focus(); document.getElementById('<%= <TextBoxName>.ClientID %>').select(); } window.attachEvent("onload", LoadFocus); } This will work for IE, but not sure about attachEvent for ff...would have to check if required.

    ASP.NET question javascript

  • Getting data from two tables in a repeater
    D daniel__c

    You could probably use a nested repeater if you wanted to bring the data back in a dataset and provided information about the relationship between the two tables, but if you just need to display like above then this would be the better option. Good luck.

    ASP.NET csharp asp-net database sysadmin algorithms

  • Why the exception "Object reference not set to an instance of an object." occurs?
    D daniel__c

    could be because if there is no user that matches the username there won't be any data at Table.Rows[0].ItemArray[0]....well that seems the most likely anyways.

    ASP.NET question

  • How to store data from Listbox
    D daniel__c

    You are getting an error because the ListBox2.Items.ToString() function just returns the text System.Web.UI.WebControls.ListItemCollection - because that is what you are referencing....it's just a collection. You would need to loop through each of the ListItems and get out the text value of each and run that as a seperate insert...i.e. foreach(ListItem item in ListBox2.Items){ str = "insert into a_software (soft)values('" & item.Text & "')" //then run the insert } that would be a way to do it using your current code, or build up a collection of inserts and run them all at once (not sure if you can do that with ExecuteNonQuery() though) - running everything at once would definitely be the better option.

    ASP.NET database graphics design help tutorial

  • Getting data from two tables in a repeater
    D daniel__c

    Depends on what you want to do with the boatcats data i guess, but i will assume this is what you want in the repeater: Boat Category Boat Name Boat Name Boat Category Boat Name ... then you wouldn't need to have a nested repeater, you could do it in one repeater and just do a join in you database query: "Select * from boats join boatcats on boatcats.id on boats.boatcats.id order by boatcats.name, boats.name" (returning all fields from boats and boatcats) and order on the category name then the boat name. OR "Select boats.*, boatcats.title [boatCategoryTitle] from boats join boatcats on boatcats.id on boats.boatcats.id order by boatcats.name, boats.name" (returning all fields from boats and boatcat title) and order on the category name then the boat name. That way you can just put in two placeholders within the and on the placeholder have visible="<%# ShowCategory(Container.DataItem) %>" (for the header placeholder) then visible="<%# !ShowCategory(Container.DataItem) %>" (for the boat section placeholder). Then put a function ShowCategory(object dataItem) which works out whether this is the same category as the last, if not store the category name and show the header. Have another function inside that displays the name of the category. Then display whatever you want in the body section.... Does that make sense?? Is that what you are trying to do??

    ASP.NET csharp asp-net database sysadmin algorithms

  • Masterpage won't postback in firefox
    D daniel__c

    Ok, have worked out what is causing the problem.. The

    element had an id on it "Form1", i removed the id and it is now working. Haven't run into this one before, but usually working with IE - which doesn't have a problem with it.

    ASP.NET help question learning

  • Masterpage won't postback in firefox
    D daniel__c

    Hey All, Have had a search around for others having this problem and haven't been able to find a fix or workaround. I have a site using masterpages - and i am putting a link to logout in the master page, using a handler in the code behind. So in the masterpage would be:

    then code behind: protected void Logout_Click(object sender, EventArgs e){ DoSomething(); } (I have also tested using an ID for Logout link button and attaching to the click event OnInit but that doesn't seem to make much difference either) So i would expect this to work as usual, which it does in IE - but firefox doesn't like it and won't postback when the button is clicked. And of course it has to be firefox compatible. I have also tried moving the link into a seperate control so that the handler is not in the masterpage code behind and loading just the control into the masterpage and this doesn't work either. It seems like buttons won't fire events unless they are in the content place holders - not directly in the masterpage. Has anyone seen this problem - and is there a workaround to get the postback to fire in firefox? Thanks in advance for any help.

    ASP.NET help question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups