Missing Step in, Step Out and Macros in VS.Net#

A while back I had some problems with a coworkers VS.net settings.

They were missing the step in and step out as well as the Macros option in the tools menu.

We were able to get these back by changing the VS.Net settings by going to Tools->Import and Export settings.

Then select to Import settings and pick where you want to backup your current settings.

Then I think we picked "Visual Basic Development Settings" or maybe "General Development Settings."  This seemed to get things back to normal for the most part.

I still have a few problems, like if I am working on some file, that file will not be highlighted in the solution explorer (what a pain) and I can't right click on a webform and select "View Code" (what a pain).

It looks like MS was trying to make it really customizable, but I think they ended up making it a pain to get things working the way you expect them to.

 

UPDATE:
I was able to quickly find a setting to make sure that the current page I was working on became tracked in Solution Explorer:

 

Categories: Programming | .Net | VS.Net
Wednesday, November 01, 2006 4:38:40 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Custom Credentials for SQL Server Reporting Services 2005 Web ReportViewer#

SQL Server Reporting Services 2005 allows you to connect with a web based ReportViewer control.

This control needs to provide credentials for the reporting server to authenticate the user requesting the report.  By default, the account running the asp.net worker process is used, but you can use the code in this forum posting to create you own custom credentials.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=409854&SiteID=1

 

Categories: Programming | SQL Server | Reporting
Tuesday, October 24, 2006 3:34:26 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Anti-Spam GreyListing#

I recently started getting some soft bounces coming back from Yahoo. 

I believe that this is a "greylisting" operation on their part:  "Message delivery has been delayed."

The typical "lists" are Blacklists (all email is rejected) and Whitelists (all email is accepted).

Greylists utilize what is called a soft error, or soft bounce on the email server. 

When sending an email, there are some errors that cause the transmission to fail and halt, and there are others that indicate that the sender should "try again later."

For example, if you try to send an email to an account that doesn't exist, the sending server will not try to deliver the message again.  But if the error is something like "Mailbox is full", then the sender will keep trying N number of times.

Almost all spammers will not bother to resend these soft bounces.  They are kicking of millions of emails, it isn't worth their time to deal with these soft bounces.

So greylisting does the soft bounce, and sees if the sender tries again.  If they do, then yahoo labels them as an OK sender, and allows their email through.  If they don't try again, yahoo can label them a spammer, and block them out.

 

Categories: Networking | Email
Tuesday, October 24, 2006 3:31:48 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

AJAX Toolkit Library Growing#

A while back I was looking at the AJAX toolkit page (http://ajax.asp.net/ajaxtookit) and I was really not impressed with anything I saw.

Things like the "Confirm" button, which is basically a button with 10 seconds of javascript coding built into it isn't a big deal, IMO.

But their list of controls has really grown and there are some really interesting things in that toolkit.

It still boggles my mind that they don't have an autocomplete dropdown list where your selections are LIMITED to the choices from the list.

 

Categories: Programming | .Net | AJAX | Javascript
Tuesday, October 24, 2006 3:29:30 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

ReportViewer with heigh=100%#

When you try to assign the web reportviewer control to a height of 100%, it displays as a very short (height wise) format.  For me, adding the style attributes to the form did the trick.

The solution to this problem was found on this page: http://msdn2.microsoft.com/en-us/library/ms252090.aspx.

Considerations for XHTML and ReportViewer Web Server Control

If you configure the ReportViewer Web server control to run in asynchronous mode in an application that is written in XHTML, you must follow specific steps to display the ReportViewer control properly. If the ReportViewer control uses relative height (for example, if the height is specified as a percentage of available space), the control collapses to a height of 0 pixels as a result of how frames and DIV tags render in containing tables in XHTML. You can avoid this problem by using one of the following workarounds:

  • Explicitly set the height on the on the ReportViewer control to an actual value rather than a percentage.

  • Add the following style setting to the head tag:

    <style>html,body,form {height:100%}</style>.

    By forcing the html, body and form tags to maximum height, the frame used in the ReportViewer control will also grow to maximum height, making it visible on the page.

  • Remove the xhtml doctype from the page.

Categories: Programming | Database | SQL Server | Reporting
Tuesday, October 24, 2006 3:27:04 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Open letter to John Madden... very funny.#
This article is a (fake, but funny) letter from the lowest ranked player in Madden 2k7 to John Madden.

http://www.thephatphree.com/features.asp?StoryID=3159&SectionID=2&LayoutType=1/

Very funny stuff.

Categories: Funny Stuff
Friday, October 20, 2006 3:36:13 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Using ObjectSwap To Avoid Flash/IE Activation Problems#

Recently Microsoft lost a lawsuit which required that they not "automatically" enable dynamic content in their browser, or something.

Whatever.  The result is that you now have to CLICK on flash swf files running in your browser before they will be "Activated".

The way to get around this is to use javascript to do the dirty work. 

Check out this link for a quick include that can help with the work around:

http://www.sitepoint.com/article/activex-activation-issue-ie

 

Categories: Programming | Flash | Javascript
Thursday, October 12, 2006 3:41:01 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Printing Vb.Net Forms with PrintForm Component#

Microsoft has released their first 3 Power Packs for Visual Basic 2005, which are "free Add-Ins, Controls, Components, and Tools for you to use with Visual Basic 2005 to make developing great applications even easier."

1 of the first 3 is the Microsoft PrintForm Component 1.0 , which gives you the ability to easily print a form.

I could have really used this on my last project, where I manually wrote the code to do just that.

Categories: Programming | .Net | VB.Net | VS.Net
Monday, October 09, 2006 2:58:15 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Make Use Of Culture in SQL Reporting Services Local Reports#

When using SQL Reporting services, you can format things such as dates and currency.

However, depending on the situation you might want to:

  1. Show a report with culture X on a computer running culture Y.
  2. Show a report using the same culture settings as the local computer.

To do (1), all you have to do is set the "Language" parameter of the local report in design time.

To get (2) to work, you need to set the Language parameter of the report as the expression "=User.Language".  This will set the report culture as the culture that the hosting program is running under.

If you have a program that you need to switch between different cultures, you can do so with the following line of code (which changes the culture to "English-Ireland")

System.Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("en-IE", False)

More information can be found at: http://msdn2.microsoft.com/en-us/library/ms156493.aspx

Categories: Programming | .Net | .Net Framework | Reporting
Monday, October 09, 2006 1:43:24 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Convert a String to a Byte Array in VB.Net#

I had a snippet on my site for converting a byte array to a string, but I didn't have anything for going the other way.

This function should do the trick.

Public Shared Function StringByByteArray(ByVal s As String) As Byte()
    Return System.Text.Encoding.UTF8.GetBytes(s)
End Function


Categories: Programming | .Net | VB.Net
Wednesday, October 04, 2006 3:44:23 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Regular Expressions Tutorial#

This is really a great tutorial on using regular expressions.

http://www.regular-expressions.info/tutorial.html

The information is broken down into sections, which appear on the left hand side.

 

Categories: Programming | .Net
Tuesday, October 03, 2006 3:50:20 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Upload Multiple Files w/ Progress Bar Using Flash#

This is a pretty neat example of using Flash and ASP.NET, 2 technologies that I have expreience with.

http://www.codeproject.com/aspnet/FlashUpload.asp

I will need to try this in one of my projects.

Categories: Programming | Flash
Tuesday, October 03, 2006 3:48:56 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Getting the Access Default Menu Back#

I know Access is old news, but I have recently been asked to take a look at an old Access app.

This application replaces the existing menu at the top with a custom one, which really limits what you can do.

The solution to getting the menu back is to right click in the menu area, select customize, highlight "Menu Bar" and select properties, and change "Allow hide/show..." checkbox.  After you do this, you can then add it back into your form.

Categories: Programming | Database
Tuesday, October 03, 2006 3:47:04 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Default Buttons in ASP.NET 2.0#

ASP.NET has this thing where pressing Enter on a page will cause it to be submitted, but no submit action is taken, mostly because you can have multiple buttons on a page, and it isn't sure which button it should consider clicked when you press enter.

The solution to this was the "__EVENTTYPE" field.  Click here for more info on __EVENTTYPE.

Thankfully ASP.NET 2.0 has introduced some new features to help remove this complexity.

Scott Gu blogs about the new form defaultButton property, as well as the new SetFocusOnError property of the validators here:

http://weblogs.asp.net/scottgu/archive/2005/08/04/421647.aspx

 

Categories: Programming | .Net | ASP.Net
Saturday, September 30, 2006 3:55:52 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Solution to dasBlog "Remember My Login" Not Working#

A while ago, maybe 3 months, my blog stopped remembering my login.  When I login I can click to have it remember my login, and thus when I return to the site I don't have to login every time.

Well I finally arrived at the problem. 

In IIS settings for the website, under the ASP.NET tab, if you click the "Edit Configuration" button, and then the authentication tab, you have the option to set the expiration length for the cookie, which was set to 1 hour.

I changed it to a larger value, restarted the IIS processes, and it appears to be working great now!

Categories: Blogging | Programming | ASP.Net | dasBlog | IIS
Friday, September 29, 2006 5:00:30 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

A Look Into Google's Agile Development#

Here is a very interesting article:

http://steve-yegge.blogspot.com/2006/09/good-agile-bad-agile_27.html

Google let's their employees work on whatever they want, gives amazing benefits (meals, gift certificates, stock), requires 20% of a persons time to be spent on their own side projects, doesn't have due dates, and much more. 

Sounds pretty cool! ;)

Categories: Programming
Thursday, September 28, 2006 3:47:01 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

VS.Net Macro to Narrow VB.Net Method Signatures and Function Calls#

Lately I have been doing some refactoring of code as I go through it.

Trying to name variables correctly, breaking up long methods, trying to adhere to some coding standards.

One way that I have been employing to clean up code is to convert very long method signatures, or calls to methods with many parameters from LONG single line entities to shorter multi-line blocks.

This is simple, but tedious.  So I wrote a VS.Net macro to do it for me.

Simply copy and paste the macro code (paste into wordpad first to get rid of the missing newline problem) at the bottom of this article into a macro.  Then all you have to do is highlight the entire row you want to "narrow", and run the macro.  You can always Cntl+z out of it if you want to undo the changes.

The results are good!  The following are examples of a long method signature, and a call to a method with a lot of arguments, and then the refactored results.

'*** Long method signature
Public Function ActivitySave(ByVal Activity As MyNamespace.Business.Equipment.Activity, ByVal StartTime As DateTime, ByVal EndTime As DateTime, ByVal StatusOverride As System.Nullable(Of MyNamespace.Business.Data.Criteria.Equipment.ActivityStatusEnum), ByVal Clerk As Integer) As Integer

'*** long method call
ActivityID = MainActivity.ActivitySave(Activity.ActivityID, Activity.Status, Activity.PurposeNotes, Activity.JobIndex, Activity.CategoryID, Activity.RequestedStartDate, Activity.RequestedEndDate, Activity.EquipmentID, Activity.PlanStartDate, Activity.PlanEndDate, Activity.ActualStartDate, Activity.ActualEndDate, Activity.DiscountScheduleID, Activity.DiscountOffset, Activity.CodeID, Activity.RentalRate, Activity.RowVersion, Clerk)

Here is the result of the refactoring:

'*** Refactored long method signature
Public Function ActivitySave(ByVal Activity As MyNamespace.Business.Equipment.Activity, _
ByVal StartTime As DateTime, _
ByVal EndTime As DateTime, _
ByVal StatusOverride As System.Nullable(Of MyNamespace.Business.Data.Criteria.Equipment.ActivityStatusEnum), _
ByVal Clerk As Integer) As Integer

'*** Refactored long call
ActivityID = MainActivity.ActivitySave(Activity.ActivityID, _
Activity.Status, _
Activity.PurposeNotes, _
Activity.JobIndex, _
Activity.CategoryID, _
Activity.RequestedStartDate, _
Activity.RequestedEndDate, _
Activity.EquipmentID, _
Activity.PlanStartDate, _
Activity.PlanEndDate, _
Activity.ActualStartDate, _
Activity.ActualEndDate, _
Activity.DiscountScheduleID, _
Activity.DiscountOffset, _
Activity.CodeID, _
Activity.RentalRate, _
Activity.RowVersion, _
Clerk)

 

Here is the macro.

 Public Sub NarrowMethodsAndCalls()
'Create an Undo context object so all the changes can be
'undone by CTRL+Z
Dim oUnDo As UndoContext = DTE.UndoContext

'Supress the User Interface. This will make it run faster
'and make all the changes appear once
DTE.SuppressUI = True
Try


Dim oTextSelection As TextSelection = DTE.ActiveWindow.Selection
Dim sOrigText As String = oTextSelection.Text

Dim RegExp As New System.Text.RegularExpressions.Regex("([ .=_a-zA-Z0-9]*)\(")
Dim Match As System.Text.RegularExpressions.Match = RegExp.Match(sOrigText)
If Match.Success Then
Dim sMethod As String = Match.ToString
Dim sParametersAndReturn() As String = sOrigText.Replace(sMethod, "").Split(",")
Dim sFirstLineWhiteSpace As String
Dim sb As New System.Text.StringBuilder
sb.Append(" ", Trim(sMethod).Length)
sFirstLineWhiteSpace = sb.ToString

'*** redo the first line
oTextSelection.Text = sMethod & sParametersAndReturn(0) & ", _"
oTextSelection.NewLine()
oTextSelection.Text = sFirstLineWhiteSpace

For i As Integer = 1 To sParametersAndReturn.Length - 2
oTextSelection.Text = Trim(sParametersAndReturn(i)) & ", _"
oTextSelection.NewLine()
Next
oTextSelection.Text = Trim(sParametersAndReturn(sParametersAndReturn.Length - 1))
oTextSelection.NewLine()



Else
MsgBox("failed to find function regexp match")
End If
Catch ex As Exception
MsgBox("Error: " & ex.ToString)
Finally

'If an error occured, then need to make sure that the undo context is cleaned up.
'Otherwise, the editor can be left in a perpetual undo context
If oUnDo.IsOpen Then
oUnDo.Close()
End If

DTE.SuppressUI = False
End Try

End Sub
Categories: .Net | VB.Net | VS.Net | Macros
Wednesday, September 27, 2006 10:52:05 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

SmartNavigation with Metabuilders Combobox#

I ran into a little problem trying to integrate Metabuilders combobox into an asp.net web app I am creating.

The problem was that the onload event handler was not properly firing when smartNav was turned on.

The "InitScript" was as follows:

if ( typeof( window.addEventListener ) != "undefined" ) {
    window.addEventListener("load", ComboBox_Init, false);
    alert('case 1');
} else if ( typeof( window.attachEvent ) != "undefined" ) {
    window.attachEvent("onload", ComboBox_Init);
} else {
    ComboBox_Init();

}

Well when you are using smartNav, the window.onload event is only fired the first time you reach the page.  So I used this bit of C# in the control to get it to work.

String initScript = resources.GetString("InitScript");
if (this.Page.SmartNavigation)
{
this.Page.RegisterStartupScript("MetaBuilders.WebControls.ComboBox Init with Smartnav", "<script>ComboBox_Init();</script>");
}
else
{
this.Page.RegisterStartupScript("MetaBuilders.WebControls.ComboBox Init", initScript);
}

 

Categories: Programming | .Net | ASP.Net | C# | Javascript
Monday, September 25, 2006 8:06:55 PM (Central Daylight Time, UTC-05:00) #    Comments [1]  | 

 

Generating Web Traffic#

Here is a pretty good list of articles that discuss ways to generate web traffic for your site:

http://www.copyblogger.com/increase-web-traffic/

 

Categories: Blogging
Thursday, September 21, 2006 11:10:33 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Checking for JavaScript Variable Definitions#

In some cases you need to be able to check if a variable has been defined, and if it has a value.

I recently had a problem where I needed a function to check if a variable had been defined, and if not, to return a default value "1".

The following code will check if the variable is defined, and if it is, it will also check and make sure that it isn't null, before returning the value.

 

function GetDefaultModuleId(){
    if (typeof(csDefaultModule) == "undefined"){                            
        return "1";
    }else{
        if (csDefaultModule == null){
            return "1";
        }else{
            return csDefaultModule;
        }                    
    }
}

 

Categories: Programming | Javascript
Tuesday, September 19, 2006 2:21:26 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

All content © 2010, Christopher May, Inc
Open Job Positions
On this page
Google Ads
This site
Calendar
<November 2006>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: