.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

missing event Handles variable

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
There is a missing event Handles variable found in the VB button code.What is the missing variable? Here is the code:Imports System.Data Imports System.Data.SqlClient Partial Class _Default Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' strLong Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("DB_13299_applicationConnectionString").ToString()) Try Dim cmd As SqlCommand = conn.CreateCommand() cmd.CommandText = "INSERT INTO Application ( First, Last, City, State) VALUES (@First, @Last, @City, @State);" cmd.Parameters.Add(New SqlParameter() With { _ .ParameterName = "@First", _ .DbType = SqlDbType.NVarChar, _ .Value = First.Text _ }) cmd.Parameters.Add(New SqlParameter() With { _ .ParameterName = "@Last", _ .DbType = SqlDbType.NVarChar, _ .Value = Last.Text _ }) cmd.Parameters.Add(New SqlParameter() With { _ .ParameterName = "@City", _ .DbType = SqlDbType.NVarChar, _ .Value = City.Text _ }) cmd.Parameters.Add(New SqlParameter() With { _

View Complete Post

More Related Resource Links

BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its


why do i get

BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

with the code

 below ..thanks


<form id="form1" runat="server">
               <asp:Button ID="Button1" runat="server" Text="Run Access" />
In your code behind:

missing event in RichTextBox

I'm developing an application that uses the RichTextBox extensively, I need an event that gets triggered at the moment when the vertical scroll bar of the richTectBox appears . so instead of scrolling down to see the rest of the text I want to create another RichTextBox that will hold the rest of the text which didn't fit in the first one …I want to achieve the same functionality as in MS word. I tried so hard to achieve that functionality but it wasn't successfull … I tried to fake it using the SizeChanged event but it wasn't practical because the size of the richTextBox gets changed a lot during the life time of the application   is there such event in windows forms ? … and if not , is there one in WPF ?

Event handler lightning bolt missing in VS2010


I have recently upgraded from VS2008 to VS2010 after a few months away from ASP.NET coding and I am hitting a problem I never had before. I seem to remember having a lightning bolt icon in the properties window for a web form that would automatically create the skeleton event handler code for any one of a range of page events. However, I cannot see this lightning bolt anywhere in VS2010.

Some guidance would be much appreciated. It would be a chore to have to create this code every time from scratch.


ModelChanged event handler missing event args

I have implemented a ModelChanged event handler in my AddDesigner call as follows:

             _wd.ModelChanged += wd_ModelChanged;

The code for the ModelChanged event is:

private void wd_ModelChanged(object sender, EventArgs e)
            ModelChangedEventArgs changedEventArgs = e as ModelChangedEventArgs;

            if(changedEventArgs != null)
                IEnumerable<ModelItem> itemsRemoved = changedEventArgs.ItemsRemoved;

                foreach (ModelItem modelItem in itemsRemoved)
                    if (modelItem.ItemType == typeof(Flowchart))
                        MessageBox.Show("You can not delete the base flow chart!", _appName, MessageBoxButton.OK, MessageBoxImage.Stop);

            //Add the expression text boxes to all switch and descision flow activities

The issue I have is that there are no event args coming through, when I expected there to be event arguments from the editing context. Any ideas on what I have missed?

ItemAdding event receiver has missing lookup information in afterproperties



I am working on a little event receiver for a custom list. I noticed that afterproperties for lookup fields only contain the index but NOT the value of the lookup field. This is only the case for single selection fields. Multiple selection lookup fields will carry all index and value information for all selected fields. This means for multi-selection fields you can use SPFieldLookupValueCollection to iterate and SPFieldLookupValue to access index and value separately. If you try using SPFieldLookupValue on single-select lookup fields, - because the afterproperty is incomplete -  you will receive an error message: Unknown Status Module: 33 Message: 134

The question is: Can this behavior be confirmed and is it limited to the "ItemAdding" event? Thank you very much... 


public override

FOR XML Blank Attributes missing end tag when assigning to Variable


Hi Everyone,

We have FOR XML Query that is giving the required XML with correct format when we are executing it within a stored procedure. Now when we are assigning it to a variable the attributes having blank value are being returned as single tag <Geography/>.

When not assigned variable, here is how output is looking like -



Local variable scoping in C#

In my previous post, Compiler-generated scopes for local variable declarations, I briefly touched on the issue of multiple meanings applied to the same name. In this post, I'll aim to flush out the compiler's rules with regards to binding names in their local scopes.

Compiler-generated scopes for local variable declarations

I was tasked with understanding and fixing a bug on error reporting with foreach iteration variables the other day, and it got me thinking about local variable scoping rules in C# in general. First, the bug.

Content Query Web Part missing in SharePoint 2010

If you don't see content query web part listed in the web parts list, this is because you have not enabled "Search Server Web Parts" feature in site collection features. Enable this feature and content query web part will show in the list of web parts.

Radio Button Event

Here I have explained the events of radio button with javascript.
Let me explain the scenarion first,
We are having two radio button say radioobtn1 and radiobtn2. If I click on the button 1 then I need to show one DIVor FORM. same as when I click on radiobtn 2. I have given the code for the above scenarion.

how to impose javascript event processing?


If I have some form control like textbox and I want the event handler to be located in the html instead of at the server side, how to do that? Of course I can copy paste javascript code in the aspx file. But is it possible to do that using some object oriented approach (ie programmatically in the code behind)?


Retrieving a variable from a previous page



I'm looking to have a search page where a user will select an item from a listview, then then taken to another page that wil display data based on their original selection.

A user will type in a string and be presented with a list of usernames that are like that string, when they select a user name who's profile they would like to view I would like the page that they're taken to, to be that users profile.

How would I transfer the variable from the search page to the profile page, and when I work on the profile page, how can I access that variable?


Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

Embeb a variable number of videos


I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?

How to take value of bound field of grid in a variable or in a textbox.


How to take value of bound field of grid in a variable or in a textbox.

 I m using this code in .aspx page for grid.

<asp:GridView ID="Grd_Mprocess" runat="server" AutoGenerateColumns="False"

                      Width="100%" AllowPaging="True"


                      AllowSorting="True" PageSize="5"  >

                 <RowStyle CssClass="odd" />


<asp:BoundField HeaderText="DOC_TYPE_PK" DataField="DOC_TYPE_PK"  Visible="true" >


  <asp:TemplateField HeaderText="DOC TYPE ID" Visible="true">  &nbs

Hidden variable has no value


I know I have a valid solution, but the js is telling me that the value in the hdnRecordSaved variable has no value!
Even when I specify in my function the following, it still tells me it has no value:
var myTextField = document.getElementById('hdnRecordSaved');

When I put the full value of the variable in (ctl00_ctl00_cphTopCenter_cphCenter_hdnRecordSaved.value), I get the correct contents back ("1"), which I set in my code behind. However, I would prefer to just put the short name in since the masterpages may change, etc. Unfortunately, I know I can get around this with VS2010, but we are using VS2008.

What am I doing wrong with the js naming conventions that can't give me the contents? Here is my below js.

<asp:Panel ID="pnlMapFields" runat="server" ScrollBars="Both" Height="430px">

<telerik:RadTreeView ID="RadTreeView1" runat="server" DataTextField="Description"

DataFieldParentID="MapFieldparentID" DataF

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend