|
you can do it in two ways:
1. (preferably this) on client using javascript: add onchange attribute to dropdownlist and call a javascript function showHideButton like..
add attribute in code behind:
dropdownlist.attributes.add("onchange", "javascript:showHideButton(this.selectedIndex);")
javascript:
function showHideButton(index){
if(index > 0){ // i am assuming you have --NEW-- at zero index
document.getElementById("createuser").style.visibility = "hidden";
document.getElementById("createuser").style.display = "none";
document.getElementById("updateuser").style.visibility = "visible";
document.getElementById("updateuser").style.display = "block";
}
else {
document.getElementById("createuser").style.visibility = "visible";
document.getElementById("createuser").style.display = "block";
document.getElementById("updateuser").style.visibility = "hidden";
document.getElementById("updateuser").style.display = "none";
}
}
in the above case you have to create two buttons and hide one on loading of the page..
i suggest you to create only one button and change its text to Create User ot Update user on changing the value of list... on click event of button in code behind check its text and act accordingly..
2. on server side:
set autopostback=true for the dropdownlist.
then write a onselectedindexchanged handler in code behind and set visible=true or false for each button depending on selected index of the dropdownlist..
-----
|
|
|
|
|
I want to create an Access Database for my website...essentially like a guestbook example but with more data. Do I need Visual Studio to accomplish this or can I simply create script and ftp it to my server? BTW, I do have MX Studio...so I have Flash and Dream Weaver. Sorry about stupid question but I am new to this. Thanks,
Grousedog
|
|
|
|
|
You don't need Visual Studio, it's possible to write all code using any generic editor like Notepad, but Visual Studio contains a lot of stuff that makes it a lot easier.
You can download Visual Web Developer Express Edition[^] for free from Microsoft.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I'm writing a web service! Can you tell me how can I get my web service namespace from code.
For ex:
<webservice(namespace:="http: tempuri.org="" ")="">
...
Public Class Service
Inherits System.Web.Services.WebService
<webmethod>
Public Function HelloWorld() As String
Return "HelloWorld"
End Function
Public Sub GetWebServiceNameSpace()
'How can I get Web service Namespace
End Sub
End Class
Thanks,
Hung
-- modified at 12:01 Thursday 20th April, 2006
|
|
|
|
|
|
thanks minhpc_bk but I can't get namespace of own webservice
for ex:
|
|
|
|
|
Hung,
Below is a quick example:
Namespace myns
Public Class MyWebservice
Inherits System.Web.Services.WebService
Public Function getNameSpace() As String
'How can I get the namespace of this webservice (it's namespace is "myns"
getNameSpace = Me.GetType.Namespace
End Function
End Class
End Namespace
.....
Dim service As myns.MyWebservice = New myns.MyWebservice()
Dim nspace As String = service.getNameSpace
'The nspace object returns the "myns" value.
|
|
|
|
|
I create a web service (.asmx file) and I don't think I will make new object of my web service as your code:
Dim service As myns.MyWebservice = New myns.MyWebservice()
Dim nspace As String = service.getNameSpace
The VS Studio 2005 generate code like that:
<webservice(namespace:="http: tempuri.org="" ")="">
<webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)>
<global.microsoft.visualbasic.compilerservices.designergenerated()>
Public Class Service
Inherits System.Web.Services.WebService
Public Function getNameSpace() As String
Dim namespace as String = Me.GetType.Namespace
Response.Write(namespace) 'So I want to get namespace from here 'not until making new object.
End Function
End Class
End Namespace
And I want to get it's namespace without create new object.
Thanks,
Hung
|
|
|
|
|
r u want to use webservice in your application ????????
jitendra
|
|
|
|
|
I create a web service and put it on server. The web service itselft will get it's namespace and respond for client.
have you got any ideas?
Hung
|
|
|
|
|
but i need to show users in a list box too...(withput flashing the page )..urgently..the chat is part of my graduation project..plz help ..thanks for every one can help....bye
|
|
|
|
|
Hi All... Currently i am doing my banking application using ASP.Net,C#, SQL Server2000... i want some technical solution realated securities from you guys as follow..
i already logged to my application by using username and password.. after login page my home page Home.aspx coming on screen.. i have features all like Balance Inquiry, Mini Statement, Last Transaction, Private Banking, Net Banking in my Home Page in left menu side. All Features are working very well.. For Security Reason i want some technical help from all of you guys...
Problem is After my successful login page If i not touch the Home page or if i not click on any features available in home page for 10 minutes.. Like if i click on Balance Inquiry Link after 10 minutes that time Page Login.aspx want to open instead of BalanceInquiry.aspx... After my successful login by username and password i want to open page BalanceInquiry.aspx (do not want open Home.aspx Page Again)... For that what i have to do in my Application to make more secure... if u have any articles link then please send me..
Please Please Help me if you people have some technical solution... Bcz right now i am on mid way of that project... if u have any articles or articles link please help me out....
Regards,
Patel...
|
|
|
|
|
follow the teps:
1. set the session.timeout = 10 in code or in web.config
2. after login store anything in session that is unique for everyuser (probably username). In pageload of everypage check if that value still exists in session if not redirect to login page and force the session to expire using session.abandon or session.removeall you may also delete the cooki for the session.
3. use http_referer to redirect to the same page after login again (balance sheet or so..) check if referer is nothing then redirect to home page otherwise redirect to referer..
you can even give warning before expiry of session using javascript settimeout ..
-----
|
|
|
|
|
hi all,
On one page of the application validators are not getting fired.
can please any one give me clue what could be the reason?
neoms21
|
|
|
|
|
From your message it is not clear that which validation control are you using. Anyway, please make sure that you have enabled the validation control by using Enabled property. Apart from that check whether you have enabled client side validation for that page. If yes, give appropriate error message so that you will get notified.
Hope this will help you
Thanks
Rakheesh
|
|
|
|
|
i have already checked for all things mentioned. but the thing is that requiredfieldvalidators are getting fired on the development server when i deploy the application on LIVE environment validators dont work only on one page of the application. Rest are working fine.
looking for your advice.
Manoj
|
|
|
|
|
Does anyone know of any good ASP.NET 1.1 Web User Profile tutorials or articles. I'm really just looking for ground floor db schema and something that uses MemberRole.dll. Something interactive with AD. Any help in the correct direction would be greatly appreciated.
**DAN**
|
|
|
|
|
Not sure if you have checked out the MemberRolesSDK[^], and the CommunityServer[^] is a good example that you want to see how to use this library. Also, as you may already know that this library is replaced in the ASP.NET 2.O with the provider kits, so you may find the provider documentation in MSDN useful too.
|
|
|
|
|
is it possible using atlas.
|
|
|
|
|
hi,
i have my site ready for deployment. i want my site to come in first 20 results of google search engine. is it search engine optimization? plz help me out
regards,
Boon
|
|
|
|
|
There are mainly two things that decide the search result position in search engines:
1. The contents of the page.
2. Other pages linking to your page.
---
b { font-weight: normal; }
|
|
|
|
|
Is there any clientside javascript available to the gridview? I know Infragistic's has a great array of commands but, prefer to use the GridView in the app.
Is there anyway to select a row on the GridView without posting back to the server?
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
well you can use javascript to do it.. I have done it with datagrid and i belieev you can do the same way with gridview..
ondatabound add onclick attribute to the item (row) e.g.
simplest...
item.attributes.add("onclick","javascript:this.style.backgroundcolor=red;")
a bit complex..
item.attributes.add("id",item.clientid)
//above line is optional if you need to search by id on client
item.attributes.add("onclick","javascript:selectRow(this);")
or for double click
item.attributes.add("ondblclick","javascript:selectRow(this);")
and then in selectRow function do whateevr you want to dso on client..
-----
|
|
|
|
|
Why when send mail from localhost is still on queue folder
and not arrive to receiver
> > > I am using ASP.NET SmtpMail to send email using the following code
> > >
> > > public void SendEmail(string From, string To, string Subject,
> > > StringBuilder
> > > Message, string Attachment, string mailFormat)
> > > {
> > > MailMessage mailMessage = new MailMessage ();
> > > mailMessage.From = From;
> > > mailMessage.To = To;
> > > mailMessage.Subject = Subject;
> > > mailMessage.Body = Message.ToString ();
> > >
> > > if(mailFormat == "T")
> > > {
> > > mailMessage.BodyFormat = MailFormat.Text;
> > > }
> > > else if(mailFormat == "H")
> > > {
> > > mailMessage.BodyFormat = MailFormat.Html;
> > > }
> > >
> > > SmtpMail.SmtpServer = "10.0.0.1";//or "localhost" or "127.0.0.1"
> > > SmtpMail.Send (mailMessage);
> > > }
> > >
> > > This code executes fine without error. But the email goes and sits in
> the"C:\Inetpub\mailroot\Queue" folder.
> > > SMTP service is running and cdosys.dll and cdonts
thanks for all
|
|
|
|
|
is there any error in ur page?
coolsweety
|
|
|
|