Click here to Skip to main content
15,887,135 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to get the index of the gridview with click of asp button Pin
laziale8-Mar-10 5:48
laziale8-Mar-10 5:48 
AnswerRe: How to get the index of the gridview with click of asp button Pin
jayantbramhankar9-Mar-10 9:51
jayantbramhankar9-Mar-10 9:51 
QuestionSpecial character Diplay problem Pin
Syed Shahid Hussain8-Mar-10 4:31
Syed Shahid Hussain8-Mar-10 4:31 
AnswerRe: Special character Diplay problem Pin
Brij8-Mar-10 5:35
mentorBrij8-Mar-10 5:35 
GeneralRe: Special character Diplay problem Pin
Syed Shahid Hussain9-Mar-10 0:47
Syed Shahid Hussain9-Mar-10 0:47 
AnswerRe: Special character Diplay problem Pin
Sandeep Mewara8-Mar-10 9:48
mveSandeep Mewara8-Mar-10 9:48 
GeneralRe: Special character Diplay problem Pin
Syed Shahid Hussain9-Mar-10 0:46
Syed Shahid Hussain9-Mar-10 0:46 
QuestionCustom Events on Custom Controls and fire it Pin
Julien Lacoste8-Mar-10 4:04
Julien Lacoste8-Mar-10 4:04 
Hi All,

I need to implement on my form, a feature to automaticaly store the old value of the cotnroles on a database if the user press a button to save the value. One way is to code it for each control on the ButtonClick event but it's too heavy to do and no fearly nice.

So, a good way is to declare inherited controls, add properties and declare events. On the form, when the user press the button, raise the event and for each control whose has the value changed and saved it to disk.

I need also to pass arguments on the Event to stored it on the database.

I have implemented the following but the event on the custom controls is not fired. So I do not know what is wrong.

First:
On the /APP_Code subdirectory, I have created a class called "MyControls" like this:

namespace MyControls
'need this class to customize argumentso to pass in tge event
Public Class SaveEventArges
myproperties...
End Class

Public Delegate Sub SaveEventHandler (ByVal sender As Object, ByVal e as SaveEventArgs)

Public Class ComboBox
Inherits .....
myproperties and methods ...

Public Event Save as SaveEventHandler

Protected Overridable Sub OnSave (ByVal sender As Object, ByVal e as SaveEventArgs)
RaiseEvent Save(me, e)
End Sub

Protected Sub ComboBox_Save ( ByVal sender As Object, ByVal e as SaveEventArgs) Handles Me.Save
mySaveCode
End Sub
End Class
end namespace

Second: On my form

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" >
<%@ Register TagPrefix = "mc" Namespace = "MyControls" %>
...
<mc:combobox runat="server" id="TextComboBox" &gt;&lt;="" mio:combobox="">
<asp:button runat="server" id="Btn" text="Press">
....

On the code behind:
Imports MyControls
....
Public Event Save As SaveEventHandler
Protected Sub Btn_Click ....
Dim t as New SaveEventArgs
my t... properties to pass to the event
RaiseEvent Save (me., t)
End Sub

What am I doing wrong?

I spent 4 days reading how to do it and no way to found a solution, so please i need your help.

Regards
Julien Lacotse

QuestionHow to Fill GridView Fast Pin
Manish_Kumar_Nayak8-Mar-10 1:07
Manish_Kumar_Nayak8-Mar-10 1:07 
AnswerRe: How to Fill GridView Fast Pin
Abhijit Jana8-Mar-10 1:31
professionalAbhijit Jana8-Mar-10 1:31 
AnswerRe: How to Fill GridView Fast Pin
Anurag Gandhi8-Mar-10 1:59
professionalAnurag Gandhi8-Mar-10 1:59 
AnswerRe: How to Fill GridView Fast Pin
Brij8-Mar-10 2:34
mentorBrij8-Mar-10 2:34 
AnswerRe: How to Fill GridView Fast Pin
R. Giskard Reventlov8-Mar-10 2:41
R. Giskard Reventlov8-Mar-10 2:41 
QuestionGetting Error "Internal .Net Framework Data Provider error 12." Pin
krishnaveer8-Mar-10 0:10
krishnaveer8-Mar-10 0:10 
QuestionHow to call Activex Control methods using javascripts? Pin
Prasadsm8-Mar-10 0:04
Prasadsm8-Mar-10 0:04 
AnswerRe: How to call Activex Control methods using javascripts? Pin
Anurag Gandhi8-Mar-10 2:04
professionalAnurag Gandhi8-Mar-10 2:04 
GeneralRe: How to call Activex Control methods using javascripts? Pin
Prasadsm8-Mar-10 2:17
Prasadsm8-Mar-10 2:17 
QuestionSend email with Cc and Bcc using smtpmail class smtpmail.smtpserver 127.0.0.1 Pin
Member 42883237-Mar-10 23:39
Member 42883237-Mar-10 23:39 
AnswerRe: Send email with Cc and Bcc using smtpmail class smtpmail.smtpserver 127.0.0.1 Pin
Abhijit Jana8-Mar-10 0:33
professionalAbhijit Jana8-Mar-10 0:33 
GeneralRe: Send email with Cc and Bcc using smtpmail class smtpmail.smtpserver 127.0.0.1 Pin
Member 42883238-Mar-10 18:48
Member 42883238-Mar-10 18:48 
Questionhow to save image in sql server using asp.net with c# Pin
developerit7-Mar-10 20:31
developerit7-Mar-10 20:31 
AnswerRe: how to save image in sql server using asp.net with c# Pin
Vimalsoft(Pty) Ltd7-Mar-10 20:52
professionalVimalsoft(Pty) Ltd7-Mar-10 20:52 
AnswerRe: how to save image in sql server using asp.net with c# Pin
Brij7-Mar-10 20:56
mentorBrij7-Mar-10 20:56 
AnswerRe: how to save image in sql server using asp.net with c# Pin
sashidhar7-Mar-10 23:10
sashidhar7-Mar-10 23:10 
GeneralRe: how to save image in sql server using asp.net with c# Pin
developerit8-Mar-10 18:29
developerit8-Mar-10 18:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.