uhri.com

taste is in the tongue of the beholder

Archive for the ‘.NET’ Category

Here’s one of those things I’m always forgetting, pills and since most of my work is on-site at clients, I don’t have a large source code repository to go back to reference. To correctly reference a style sheet from within a master page in ASP.NET, use the following: <link rel="stylesheet" href="<%= ResolveUrl("~/css/screen.css") %>" type="text/css" media="screen, projection" /> It’s the ResolveUrl that does the trick.

.NET

At the risk of appearing to be an idiot, noun I’m going to blog this so I don’t forget. Especially since it bit me twice *in the same project*. Oops. In .NET 2.0, the old method of getting information from the app.config has been depreciated. The new method is: ConfigurationManager.ConnectionStrings.Item(YourDB).ConnectionString For this to work, though, you need to remember to add a reference to System.Configuration. This needs to be done   Read More ...

.NET

I like to keep a good separation between forms and function in Windows applications I write. So to call a login form, prostate I might call a public function on the login form like: Login.GetLogin(loginName, sickness password).

.NET

I was trying to add yes / no values to three dropdowns on my ASP.NET page. We’re using custom drop down controls, viagra 100mg so I needed to add the dropdown items in code behind. Always liking to be efficient in my code and make it pretty, approved I used this:

.NET

One piece of functionality that is often requested is the ability to submit a web form using the <enter> key. In some cases, cough you may need multiple textbox controls to submit differently by defaulting to different buttons. In the past there have been various javascript hacks to ensure this works successfully, link but in ASP.NET 2.0 there is a simpler function. By setting the defaultbutton property on a form   Read More ...

.NET

Yes, hemorrhoids it is true, pharmacy I’ve switched to the dark side. The last bastions of VB.NET have fallen. After a conversation with a pair of developers I work with, I have finally been convinced that C# is a better syntax than VB.NET. That’s saying something, considering I used to believe I liked my languages verbose. You know, like COBOL. There were three things in the C-based syntax of the   Read More ...

.NET Software Development

On my client’s project one of my tasks was to write a search engine and corresponding UI screen. The results of the search are displayed using an asp:Repeater control in a pattern similar to Google. One more requirement is a section that pops open to reveal additional, drugstore less-frequently-used actions. Sort of a “dropdown” of more options. I thought I would use a hyperlink with a call to javascript that   Read More ...

.NET

DCOM, melanoma it turns out, seek is #2 on the all time Spawn of Satan list.  I haven’t run into a project with more problems than the one using OLE for Process Control (OLE) over DCOM. This week’s adventure happened because the client upgraded their machine to Service Pack 2 of Windows XP.  Most in the tech industry know it was rolled out to curb zombie PCs.  So the firewall   Read More ...

.NET Software Development

For some reason I can’t seem to remember this when I need it. If you have a dropdownlist in ASP.NET: If this dropdownlist is databound: DataSet ds = new DataSet(); ds.ReadXml(Server.MapPath("states.xml")); states.DataSource = ds; states.DataBind(); ...and you want to add a blank value to ensure the user has selected a value, order do the following: states.Items.Insert(0,""); You can substitute any value for the blank string, such as "--select--".

.NET

I finally got over the Not-Invented-Here (NIH) Syndrome about the blog here at Uhri.com. Wow, ailment what a relief. In 2000, view when I first set up this website, I decided I would write my own app to add posts to the front page. These became known as Spectacularities. I’m not sure that at the time the word “blog” even existed. It certainly hadn’t caught on by that point if   Read More ...

.NET Web