|
Well I would employ javascript to do that, actually, like this:
In your code behind, add this line(in Page_Load, or wherever):
ImageButton1.Attributes.Add("onmousedown", "OnMouseDownButton()");
On your aspx page (somewhere in the head tag, or in an .js file if you have one linked, add this:
function OnMouseDownButton()
{
document.getElementById('ImageButton1').src='yourotherimage.jpg';
}
Remember to add the script tag over the actual script
|
|
|
|
|
Hi Greg,
thank you for your help. I did it as explained, and actually seems to be a problem with the image path, it seems unable to find it. The image is in a regular folder named /Recursos/Iconos/, this folder is nested directly above the solution folder.
In C#, it works fine using the prefix "~" (~/Recursos/Iconos/imageclic.png), but i don't know if it must wok the same way inside a script (inside the .aspx tag).
(excuse my poor english)
|
|
|
|
|
alvarog01 wrote: In C#, it works fine using the prefix "~" (~/Recursos/Iconos/imageclic.png), but i don't know if it must wok the same way inside a script (inside the head .aspx tag).
You have to provide the relative path to it, or the weburl itself!
So you either do ../../Recursos/Iconos/imageclic.png (or as many ../ as you need),
or www.foobar.com/Recursos/Iconos/imageclic.png.
Forget about the "~" sign. Means nothing to javascript, far as i can tell
And if it does it's beyond me ;>
And don't worry, your English is fine.
var question = (_2b || !(_2b));
|
|
|
|
|
Thanks a lot Greg, it finally worked!!
|
|
|
|
|
Hi in my machine i have installed .net framework2.0 and ajax extension...,
i am trying for updatepanel concept...,
if my controls are in inside the update panel also...,i am getting page postback,
Is there extra anything i ahve to install in my machine...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
i create a textbox1 named rno , second textbox2 named stdname and 1 Find button
i want to enter the no of the student in rno click the find button and display the name of student in textbox2
i have the maintain database in sql2000
please send me solution
My id is : sanjay_raizada@rediffmail.com
|
|
|
|
|
raizadasanju wrote: i create a textbox1 named rno , second textbox2 named stdname and 1 Find button
i want to enter the no of the student in rno click the find button and display the name of student in textbox2
i have the maintain database in sql2000
Then what is the problem. You just need to write a simple SQL Suery or a SP's which take Roll name as parameter and will return the Name from the database, then display the name in TextBox.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Since you have the records in a database then you need to query the database to get the data. With no knowledge of the database nobody can write a query for you. Your next question will probably be on how to connect to the database and display the result, so I suggest you invest in a book on ado.net and another on sql.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi I am developing one application which is registering Impressions and clicks for banner advertising site. When any flash banner runs it will call to my aspx page with some value as a Query String I will catch that parameter and add into database. Our application is running on MSN India. So it will generate huge load on our server. Recently we come to know that we are loosing impression means we are not registering all impression served by server. So I downloaded Microsoft Web Stress Tool. Site Manager and One more tools to check virtually load on the server But it is display lots of bad request like Socket error, Http error, Session Error, Request failed due to 401 response something like that. So My problem is that how can I reduced this error. If Msn pinging my server 1lac time per day I want to register 1 lac impression. I don't want to loose even single impression. Is there any solution??????
http://www.tardak.com
|
|
|
|
|
Hi all,
i need to update the checkboxlist, where data come from database.
i have 3 ListItem.. Example...
English,Hindi,Chinese. with comma separated values store in database.
can you help me, how to retrieve and update the values in database.
Thanks in Advance.
JohnDas
|
|
|
|
|
Hi,
Considering the scenario for handling exceptions in Web Application where we have Presentation layer, Business layer and Data Access layer; if there any exception is occurred in DAL, what is the best thing to do:
1. Don't catch the exception in DAL and neither in Business Layer, but only in User interface layer.
2.Don't catch the exception in DAL but in Business Layer and throw them to User interface Layer.
3.Catch Exceptions in DAL and throw them to Business Layer which again throws them to User interface layer.
And please suggest me any good exception handling mechanism in these layers.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Different exceptions need to be handled differently. For example, if an exception occurs that is caused by the DAL doing something stupid, the DAL should handle it. If the user enters bad data, and it makes it to the DAL(which shouldn't happen) then the DAL should throw one that hits the presentation layer to show the user what happened.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hello forum
I've installed VS 2008 in Vista. It is working but not displaying the page in any browser. Browser is just displaying that the page can not be displayed.
Can anybody tell me what is the solution. what should I do.
Thanx
Rahul Adya
|
|
|
|
|
What page is not showing up? One that you coded? Is IIS installed correctly?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
check out the url in the displayed web page,
does it look like http://localhost:xxxx/XXXXX ?
ok, try to replace the localhost with 127.0.0.1, to make the url look like
http://127.0.0.1:xxxx/XXXXX and try it, does this work ?
if yes, then the error is from the hosts file, which maps the localhost to 127.0.0.1
which is your local machine's IP address,
to correct that just
go to C:\windows\system32\drivers\etc\hosts
open it with notepad,
and map localhost to 127.0.0.1 with adding this line:
127.0.0.1 localhost
please tell me if this doesn't fix the problem.
Web Developer
|
|
|
|
|
Thanx Friends.
I'll try and surely let u know abt the status.
But do VS 2008 needs IIS.
With warm Regards
Rahul Adya
|
|
|
|
|
Hello,
I am getting above error message. Here is my code which i am using:
...
...
tablename = clsname & exmname & Trim(DropDownList1.Text)
sql = "select * from " & tablename & " where rollno between " & TextBox1.Text & " and " & TextBox2.Text
Dim myr As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim ocn As New System.Data.OracleClient.OracleConnection
Dim ods As New System.Data.DataSet
Dim oda As New System.Data.OracleClient.OracleDataAdapter(sql, ocn)
ocn.ConnectionString = "Data Source=orcl;User ID=scott;Password=tiger;Unicode=True"
oda.Fill(ods, tablename)
myr.Load("C:\Inetpub\wwwroot\Exam2\CrystalReport.rpt")
myr.SetDataSource(ods.Tables(0)) ' This is error line.
myr.DataDefinition.FormulaFields("rollno").Text = ods.Tables(0).Rows.Item(0).Item("rollno")
myr.DataDefinition.FormulaFields("dob").Text = ods.Tables(0).Rows.Item(0).Item("dob")
myr.DataDefinition.FormulaFields("name").Text = ods.Tables(0).Rows.Item(0).Item("name")
myr.DataDefinition.FormulaFields("schcode").Text = ods.Tables(0).Rows.Item(0).Item("schcode")
myr.DataDefinition.FormulaFields("centcode").Text = ods.Tables(0).Rows.Item(0).Item("centcode")
CrystalReportViewer1.ReportSource = myr
CrystalReportViewer1.DataBind()
Since i can not give the table name in design time (it will be dynamic); so
I have create a crystal report in which i have created formula fields in the report which will be populated as above code.
Please guide and help me.
Regards
Girish Sharma
|
|
|
|
|
I am developing a webchat application in which I don't want a user to login to the site with same user name. I want first user session to expire when user logs in from other PC to the same site like in Yahoo messenger.List of users who are online is maintained in an array.Can anyone suggest me how to do it? Please help!!!
|
|
|
|
|
If the user is in the array, end the session and start a new one with the new person...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
How to end previous session???
That is what I want to know...
|
|
|
|
|
Hello,
Page_load event is firing two times, what may be the reason, what is the solution.
Thanks in advance.
Pinna
|
|
|
|
|
Page_Load runs every post back. You can try wrapping the code in a if(!IsPostBack)...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Thanks for response..
i wrote the code like that only..if(!IsPostBack)...still page_load is firing two times..
i wrote the code like below..
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
If Not IsPostBack Then
lblUserDet.Text = Session("LoginName")
End If
end sub
Pinna
|
|
|
|
|
What makes you think it is firing 2 times?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I have two textboxes in my aspx form. One is having SingleMode and the other one is having Multimode.
The issue is font looks like different stlyes in Multimode text box, eventhough both the font styles set to MS SansSerif or Aerial.
Any idea how to make both look like same?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|