|
i an not very friendly with c# so how to write this code in C#:=
Private WithEvents m_MediaConnectWatcher As ManagementEventWatcher
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
C# has no equivalent to WithEvents of VB.
You can work with event handlers instead, like:
private void Form1_Load(object sender, System.EventArgs e)
{
ManagementEventWatcher m_MediaConnectWatcher = new ManagementEventWatcher();
m_MediaConnectWatcher.YOUR_EVENT += new EventHandler(YOUR_METHOD);
}
private void YOUR_METHOD(object sender, EventArgs e)
{
}
Regards
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
but i am not getting .YOUR_EVENT after initialization.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
you need to change the YOUR_EVENT to the event you actually want to handle..
Abhishek Sur
|
|
|
|
|
In the form load you are just connecting the event to your method...the method will be called just when the event are fired.
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
Hi friend
I want the updatepanel progress bar to be displyed at absolute center of the page(Horizontal-vertcal centering). It should be done at unknown height and width. Also It should display when i m scrolling the page in a same manner.
Could you help me how to do it whether using javascript / css alone.
Thanks in advance dude
G Nathan
|
|
|
|
|
Dear All,
Could anyone help me in giving an snippet of code for calling a perl script file from asp.net web appln.
Thanks,
Savee
|
|
|
|
|
hi,
i made a application on asp.net using c# with ajax and javascript. but server is linux server.
is it possible that my application run on linux server?
if possible than what the process?
will there any changes made for application?
etc.
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
|
i am little bit confused that what is mono its a application or what is this my application is changed ? what is mono? plz help
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
"Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix"...you can think of it as the assemblies of .net, ported to Linux,etc
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
iam having a textbox where iam entering some text say user id then after entering the userid in the textbox and if user goes for next control then how can i validate that the user id entered is already there in my db.which event of the textbox works better.
|
|
|
|
|
Well, actually in asp.net you don't have an event on the validation of the control like in windows forms, but you can do like the following:
1) Put a custom validator control in your form
2) Set its ControlToValidate to your Textbox
3) Add a function to your code like
protected void ValidateTextboxInDB(object source, ServerValidateEventArgs args)
{
}
4) Bind the event handler to your method like:
<asp:customvalidator id="CustomValidator1" runat="server" xmlns:asp="#unknown">
OnServerValidate="ValidateTextboxInDB"
ControlToValidate="TextBox1"
ErrorMessage="Your error message.">
</asp:customvalidator>
Regards
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
hi caiokf Thanks for ur immediate reply .but how to call this when textbox is lost focus
means when user enters something in the textbox and comes out.
|
|
|
|
|
hi Lakshmi,
set ur textbox autopostback property to true in the properties pane of ur textbox.
and in the textbox textchange event u can validate the userid against the userid in the DB.This is very simple.
T.Balaji
|
|
|
|
|
in one of my project at one palce XMLHttpRequest object is been mase
Request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
var obj = this;
Request.onreadystatechange = function() { obj.OnReadyState(Request); };
Request.send(PostParams);
i objerved this send method executes the request but how it does work
how it executes query i could not got it
so i need guidence on it
Raghvendra
|
|
|
|
|
Googling AJAX would be a good starting point.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
i had a lots og googling abt how internally it works but could not get it
at each palce i got abt how and where to call it but internally everything was hidden
Raghvendra
|
|
|
|
|
Hello,
I have been reading about setting dynamic page titles in ASP.NET 2.0, in order to modify the "catalog.aspx" page of my web application. Most of the articles on this subject, however, seem to be describing somewhat complicated solutions for creating dynamic site maps, whereas I would just like to set the title of my catalog.aspx page to the name of the current category or product in my catalog.
Although I can see how to set the title property in code like so:
Sub Page_Load()<br />
Page.Header.Title = "The current time is: " & DateTime.Now.ToString()<br />
End Sub
...I can't figure out how to dump the contents of a <%# Container.Name %> -type container into this statement.
I am using a 3rd-party shopping cart package (DotNetCart), that displays categories and products on the http://www.mywebsite.com/catalog.aspx page in typical catalog fashion:
http://www.mywebsite.com/catalog.aspx?CategoryID=200 (The category named "Handbags")
http://www.mywebsite.com/catalog.aspx?CategoryID=200&ItemID=13 (The category named "Handbags", and the item "Canvas Handbag")
In the above examples, I'd like to have the page title change to "My Website: Handbags" and "My Website: Canvas Handbag" respectively.
The third-party vendor's catalog control looks sort of like this (extra tags and declarative controls omitted):
<dotnetCART:DisplayCatalog><br />
<CategoryTemplate><br />
<%#Container.Image%><br />
<%# Container.Name %><br />
</CategoryTemplate><br />
<ItemDetailsTemplate><br />
<%#Container.Name%><br />
<%#Container.ItemID%><br />
<%#Container.Price%><br />
</ItemDetailsTemplate><br />
</dotnetCART:DisplayCatalog>
How would I go about displaying the catalog control's Category and ItemDetails' Names in my page title attribute? Thanks for any advice.
|
|
|
|
|
I'm not familiar with dotnetcart, but if it supports databinding, then you should be able to handle one of the events, like ItemDataBound or something like that, and set the page title in the code behind.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
Hi,
I wanted to use forms authentication and for this i have to specify the paths for the folder that the
user is allowed to navigate to based on the roles he is in.
But the problem is i have 100 roles in my database. So its tedious to write authorization using the code
<location path="AdminModerator">
<system.web>
<authorization>
<allow roles="Administrator,Moderator">
<deny users="*">
Is there any other method to do this.
Thanks...
bitsbuilt
|
|
|
|
|
Hi All,
I want to set the ctrlKey value to true/false through code in javascript.
While trying to do this as shown, I'm getting an error like 'htmlfile: Member not found'.
But the ctrlKey property is read-write (as per msdn)
function f1()
{
event.ctrlKey = true;
}
Can any one help me please. *** Urgent ***
|
|
|
|
|
How is event passed, and how is your function called? It needs to be placed as the first argument in your function declaration to be referenced within the function.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
how can i pass product_id from database to query stirng .
in mainpage i m populating detailviewcontrol with all products from database
columns are
product_id,name,etc
i hv a button "detail about product"
and against button clicking following statment
Response.Redirect("detail.aspx?p_id=1)
i want to use product_id database field instead of constant '1' so that
in detailpage selected product detail can be displayed (not of product_id=1)
plz help me how to pass product_id in query string........
|
|
|
|
|
i m trying to get product_id value from detailview control and passing it as query string using following statement
Response.Redirect("detail.aspx?cat_id=" + DetailsView1.Rows(1).Cells(0).Text)
but getting error like
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
plz help me how to fix it or another way to pass product_id as querystring
|
|
|
|