Go to DotNetFunda.com
 Online : 1816 |  Welcome, Guest!   Login
 
Home > Forums > JavaScript > display error image? ...

  • Download the OOPS, ASP.NET and ADO.NET Training Videos for FREE, click here.

JavaScript Forum



display error image?

Author: Sagarp | Posted on: 2/8/2010 | Category: JavaScript | Views: 85 | Level: Starter | Status: [Member] |

Hi


i will try using java script on lode event if srting is equql display error image. on form tell me how can i do

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/


Reply

Interesting?   Share and Bookmark this

 Responses

Abhijit Jana  
Posted on: 2/8/2010 8:21:22 AM
Level: NotApplicable | Status: [Member] | Reply

Correct me If I am wrong, You want to show alert message if some string are equal in Page_Load Event ?

If yes, try like this

if(st1.equal(st2))

ClientScript.RegisterClientScriptBlock(typeof(Page), "myscript", "alert('Equla String')", true);


Let me know if you have any more issue.

Thanks !


Cheers !
Abhijit

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Sagarp  
Posted on: 2/8/2010 8:23:24 AM
Level: Starter | Status: [Member] | Reply

but don't display alert will try to display error image


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Abhijit Jana  
Posted on: 2/8/2010 8:30:48 AM
Level: NotApplicable | Status: [Member] | Reply

Please show me your code snippet and Let me know if you have AJAX ScriptManager in your page.


Cheers !
Abhijit

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Sagarp  
Posted on: 2/8/2010 8:33:00 AM
Level: Starter | Status: [Member] | Reply

using html not use sever control or ajax.simple i have check string is match create table using java script display image


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Raja  
Posted on: 2/8/2010 8:39:41 AM
Level: Starter | Status: [Member] | Reply

Below is the sample code for your solution.


<img src="/myimage.jpg" id="img1" />

<input type="button" value="submit" onclick="ChangeImage()" />

<script language="JavaScript">
function ChangeImage() {
alert(document.getElementById('img1').src);
document.getElementById('img1').src = "http://www.dotnetfunda.com/images/DotNetLogo.gif";
}
</script>


Clicking button will change the image of the <img> tag.

Thank you.


Regards,
Raja

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Sagarp  
Posted on: 2/8/2010 8:41:06 AM
Level: Starter | Status: [Member] | Reply

Hi raja,


i will use in form load event


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Abhijit Jana  
Posted on: 2/8/2010 8:49:33 AM
Level: NotApplicable | Status: [Member] | Reply

I think raja is quite correct, Call the JS function from Page load as I suggested, tell one think what is your exact scenarios , why you are not using any validation control ?


Cheers !
Abhijit

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Nishithraj  
Posted on: 2/11/2010 4:09:26 AM
Level: Bronze | Status: [Member] | Reply

In page load have a checking condition and call the javascript function if that string occures.

ClientScript.RegisterClientScriptBlock(this.GetType(), "ClientScript", "showimage()"); 


In aspx add the script calling function as follows

<script language="JavaScript">

function showimage() { alert(document.getElementById(id of image).src); }
</script>



With regards
Nishithraj Narayanan

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Sagarp  
Posted on: 2/11/2010 4:11:17 AM
Level: Starter | Status: [Member] | Reply

stop reply i have solve that problem


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Nishithraj  
Posted on: 2/12/2010 2:39:23 AM
Level: Bronze | Status: [Member] | Reply

Then mark it as resolved...


With regards
Nishithraj Narayanan

Sagarp, please login to Mark As Answer, if this helps | Alert Moderator 

Latest Posts

More ... 

 Write New Post


Advertisement

About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)