|
Not being funny but you have even tried to solve this yourself if you had it would have taken 10 minutes.
I suggest you look at this:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.imagebutton_members.aspx
and set this www.msdn.com in you favourites it will save you and us a lot of time
Dan
|
|
|
|
|
Hi Dan,
I suppose to check if the image if it will display or not. And if won't display the image it will be changed programmatically into an image - blank.jpg
Please see my source code below.
ImageButton1.ImageUrl = "~/Images/Item_Thumbs/image1.jpg"
ImageButton2.ImageUrl = "~/Images/Item_Thumbs/image2.jpg"
ImageButton3.ImageUrl = "~/Images/Item_Thumbs/image3.jpg"
If ImageButton1.ImageUrl Is Nothing or String.IsNullOrEmpty(ImageButton1.ImageUrl) Then
ImageButton1.ImageUrl = "~/Images/Item_Thumbs/blank.jpg"
End If
If ImageButton2.ImageUrl Is Nothing or String.IsNullOrEmpty(ImageButton2.ImageUrl) Then
ImageButton2.ImageUrl = "~/Images/Item_Thumbs/blank.jpg"
End If
If ImageButton3.ImageUrl Is Nothing or String.IsNullOrEmpty(ImageButton3.ImageUrl) Then
ImageButton3.ImageUrl = "~/Images/Item_Thumbs/blank.jpg"
End If
hifiger2004
|
|
|
|
|
Hey
your logic seems fine as does how you are implementing it. The one thing I would consider is rather than loading blank.jpg I would just set the appearance of of the image button to your blank colour as the code will not have an image and it will not rely on an image being there. If the image isnt there it will display funny (possibly) so is not terrible but wont look all that professional.
Dan
|
|
|
|
|
But how can I do that?
I mean, it can be set to visible = false, but at first is how can I detect if the ImageUrl is not showing the image.
If there's definite code or way on checking the imagebutton.imageurl if the image is not showing then that would be fine.
It's just like doing a code for example:
If ImageButton.ImageUrl = Image not showing then
ImageButton.Visible = false
End If
Something like that. The only thing is how to check the image if it shows
Thank you Dan for sharing your ideas
hifiger2004
|
|
|
|
|
Ahhh I see. Well if the imagebutton is not showing an image it means that it hasnt found the image or cant read it etc so what you would have to do is check the image file exists. It sounds to me like you are going to a lot of trouble to make sure an image button contains an image - just make sure that the image url always points to a valid image rather than doing all this checking or before each load check the image exists if it doesnt then hide the button.
Dan
|
|
|
|
|
Thank you for the Idea
hifiger2004
|
|
|
|
|
Just downloaded the Apple Safari web browser and playing around. Two things I am bit stuck. If somebody could help out, it would be great:
1) Any Javascript Debuggers like Venkman for Safari? Neither does Visual Studio integrate nor Venkman for FireFox is able to understand Safari integration!!
2) And BTW, why is the Proxy: Change Settings always disabled and is not available for configuration?
|
|
|
|
|
Try Web Inspector[^].
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- C hris L osinger, Online Poker Players?
|
|
|
|
|
Thank you, Shog.
Let me give it a try sometime tomorrow.
|
|
|
|
|
Hy,
I'm trying to develop a new plugin to Mozilla (etc.) browser, but before writing a single line of code, I've encountered a problem.
Ok, I know that to develop for Mozilla, I should do the coding under GECKO SDK and stuff, but I know nothing about how should I set up de enviroment to work with VS2005.
I've already read quite a lot of google, even mozilla's developer sites, but I'm confused.
Could anyone please provide me a step-by-step tutorial about setting up Gecko, XUL-runner - if needed - and any other things I might use.
Ps: Sorry if my question is offtopic, but I haven't found the proper one.
Thanks in advance :
Collapo
|
|
|
|
|
In my site I have pages with maximum of 7 query strings . I have made a sitemap of the site including all these urls and submited them to google. and google verified them. I don't know why google does'nt read all the urls specially those that are long in guery strings. Do u know why ? How can I solve this ?
|
|
|
|
|
I am doing an application in which i want to validate a textfield using javascript..
The phone text field in application should acccept only numerics.. and i wrote a javascript for that..
I wanna include the space character(hope its ascii value is 32) also in the script ..please help me...
the code i did is ...as follows...
function checkIt(event)
{
var charCode = (event.which) ? event.which : event.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57))
{
alert("Please make sure entries are numbers only.");
return false;
}
return true;
}
i call this function onkeypress event of the phone text field...
i want to include space key and enter key to the script function ...
Thanks in advance...
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
sajan ss wrote: if (charCode > 31 && (charCode < 48 || charCode > 57))
Try to think this code through, for a value of 32. Both tests actually succeed, and so you'll get your alert ( what a pain, I'd suggest removing it ).
Try this:
function checkIt(event)
{
var charCode = (event.which) ? event.which : event.keyCode;
return (charCode == 32 || charCode == 13 || (charCode >= 48 && charCode <= 57));
}
I assume if you want the alert still, you can rework this code accordingly.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This code works fine...but when i am entering some text in the desired textbox and hitting enter then the page posts itself and return error...
You checked the value of enter key in the function then how can this go wrong...
when i press enter key the control should be in the same textbox...
but it is not working ..other key works fine...
thanks for the reply...
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
OK, you didn't say that.
You need to make sure there's no default button, so that enter does not cause postback. Your code also is not going to 'work fine'. It will work fine so long as you don't press any other key that has a value between 32 and 46, or whatever it was. The implimentation is plainly flawed, even if you've failed to notice.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks ....Sorry for not saying that then...
How can I remove the Default add button property....
so that even if i press enter it should be in the text field....
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
Here[^]
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
please i need to upload image to my website. so it will be an option that allow users to upload images to the web page
thanks in advance
bachir
|
|
|
|
|
please i need to upload image to my website.
ok.
so it will be an option that allow users to upload images to the web page
description of what u want done.
Lastly, where is your question? Be specific.
---------------------------
Both optimists and pessimists are important in technology. The optimist invented the aeroplane; the pessimist invented the parachute.
Regards,
Hesbon Ongira
Nairobi, Kenya.
|
|
|
|
|
I use this PHP class for image manipulation on the server.
www.verot.net[^]
Here is some sample HTML to get the files to the server.
<br />
<fieldset><br />
<legend>Image upload</legend><br />
<p>Pick up an image to upload, and press 'upload' </p><br />
<form name="logo_form" enctype="multipart/form-data" method="post" action="logo.php" /><br />
<p><input type="file" size="32" name="my_field" value="" /></p><br />
<p class="button"><input type="hidden" name="action" value="image" /><br />
<input type="submit" name="Submit" value="upload" /></p><br />
</form><br />
</fieldset><br />
|
|
|
|
|
Try this
Image Upload
1) Find name of image
Img1=doc_file.FileName.ToString.Trim()
2) Replace blank space with “_”
Img1=Img1.Replace(“ ”,”_”)
3) Use Substring
Img1=img1.Substring(img1.LastIndexOf("\") + 1, img1.Length - img1.LastIndexOf("\") - 1)
4) Find Extension
ext1 = doc_file.FileName
5) ext1 = ext1.Substring(ext1.LastIndexOf(".") + 1)
6)Check if ext is blank or not.if not then concatenate ext with “.”
If Trim(ext1) = "" Then
ext1 = ""
Else
ext1 = "." & ext1
End If
7)Send ImageName as blank in database
8)Take new String variable
9)ImageNew=”image_” & ret.tostring & ext1
10)Check if ext1 not equal to blank
ImageNew=”image_” & ret.tostring & ext1
Then use update command
update tblImages set ImageName='" & sImg_name_new & "' where ImageId =" & ret
11)Then use Upload Function
|
|
|
|
|
Hi all,
How can i create "Drag and Drop Lightbox Pane" like website http://www.photos.com
Please help me soon, because i want to drag and drop my photos to lightbox like www.photos.com website.
Thanks,
Hy ChanHan
-- modified at 5:36 Friday 28th September, 2007
|
|
|
|
|
Does anyone know how to call a function in a VB.NET DLL from Java script code?
I'm Using like this in my .aspx page it gives error like this
"Automation server can't create Object""
how can i resolve this error
try
{
var objCom=new ActiveXObject("comMath.clsAdd");
alert(objCom.addition(3,4));
}
catch(err)
{
document.write(err.description)
}
|
|
|
|
|
Is your VB.NET dll a COM dll ? Do you realise that this will only work if you deploy your DLL to all the machines that access your site ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello friends,I upload my site on server but got the following error. What it means? I publish the site to '/test'folder on server ..Can u help me plzzz..
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load the assembly 'App_Web_nu4dn8zr'. Make sure that it is compiled before accessing the page.
Source Error:
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="Webmaster_AdminLogin, App_Web_nu4dn8zr" debug="true" %>
Line 2:
Line 3:
Source File: /test/webmaster/adminlogin.aspx Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
|
|
|
|