|
Try to add
form1.Attributes.Add("onkeydown", "return false;");
to the Page_Load()
This way any key pressed on that page will be ignored (as all you need is the mouse to press the buttons).
|
|
|
|
|
Hi all,
I am having problems with my visual studio project. i cant execute my project.It comes up with the above error every time i try and run the program.
I copied the Webdev file from a working PC however,with no success.
Please advice
Thank you
|
|
|
|
|
i want to disable imagebutton.
ImageButton1.Enabled = false; this is not working ?
any suggestions.....
|
|
|
|
|
in which part of the code you do this?
|
|
|
|
|
|
Well, duh. What method ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
iwant to disable image button.
if (this.PageNumber == 1 )
{
ImageButton1.Enabled = false;
}
else
{
ImageButton1.Enabled = true; ;
}
THIS IS NOT DISABLING THE IMAGEBUTTON.
|
|
|
|
|
God.
WHERE DO YOU CALL THIS CODE ? IN WHAT METHOD ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
iam having the 1 to 11 pages .
Previous and Next image buttons .
If iam in First Page PREVIOUS IMAGE BUTTON should be disable.
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if (this.PageNumber == 1)
{
Response.Redirect("pge1.aspx");
ImageButton1.Enabled = false;
ImageButton2.Enabled = true;
}
else
{
this.PageNumber -= 1;
Response.Redirect("pge" + this.PageNumber.ToString() + ".aspx");
}
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
if (this.PageNumber == 11)
{
//ImageButton1.Enabled = true;
//ImageButton2.Enabled = false;
//lnkNext.Enabled = false;
Response.Redirect("pge11.aspx");
}
else
{
ImageButton1.Enabled = true;
this.PageNumber += 1;
Response.Redirect("pge" + this.PageNumber.ToString() + ".aspx");
}
}
|
|
|
|
|
Oh, you're the guy from the other day. I see your code is still a disaster. You still have the same issue you had the other day. Refer to my answers from then, no point in repeating them if you're going to ignore me.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I don't know what's more depressing, that you'd sit on such a trivial problem for days ( and I assume you're just going to ask it again ), that you'd ignore the advice you're given and just stop posting when someone reminds you that you have a solution, or that someone is paying you to sit idly by because you can't work out how to solve a simple problem when you've been given a clear solution.
Do some research on what response.redirect does. Or, just think about it for a minute.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Please DON'T SHOUT!
however, how are you setting PageNumber? What is passing it around?
|
|
|
|
|
This guy has asked this and I have explained to him the many issues with his code. He's not changed any of it, I would say it's not worth talking to him, he obviously ignores people who try to help.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hi
I currently have a javascript function which is applied to a gridview:
GridView4.Attributes.Add("onkeydown", "return noCopyKey(event);");
how cann i apply this function to a whole page?
thanks
|
|
|
|
|
you can't magically do it, you need to add it to all the controls you want to use it.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I wasnt hoping for magic I was hoping there was a line of code which you could add it to page rather then just one control at a time.
|
|
|
|
|
Sure - I don't think so.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
i managed by using the other persons response: put onkeydown="return noCopyKey(event) in body tag on masterpage managed to get it to work. Have to put javascript in the actual pages though not just in masterpage
cheerS!
|
|
|
|
|
How about...
onKeyPress event for body tag
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
the probably with that is the only body tag I have is in my masterpage, if I put the javascript there it doesnt work
|
|
|
|
|
Fixed, mispelt my function
cheers!
|
|
|
|
|
Hi all,
I have a windows service application that needs to make request to a remote web service (https:// ...) for uploading files. the contact mechanism between them is a SSL based channel.
I assigned my windows service to run under a specified user account and installed the client certificate with that user account as well.
And I am getting this exception as title, however, strange enough, I do not get this exception all the time, i got this exception sporadically. Does it prove that I did configure certificate properly? if so, what other reasons would cause this exception???
Any suggestion would be appriciated!!
Ming
|
|
|
|
|
I now have a problem with a piece of code which worked before!
My code to get an image object from a directory is:
System.Drawing.Image fullSizeImg = System.Drawing.Image.FromFile(imgFullPath);
Then I resize it as follows:
System.Drawing.Image thumbNailImg = fullSizeImg.GetThumbnailImage(newWidth, newHeight, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
In the debugger, fullSizeImg and thumbNailImg are {System.Drawing.Bitmap} so they must be ok. However, when I use the following code to save the image:
thumbNailImg.Save(fullPath);
I get the error message:
CS0103: The name 'thumbNailImg' does not exist in the current context
However, if I try and save the fullSizeImg (before resizing) this works fine, so I'm totally confused and desperate for help!
|
|
|
|
|
Forgive me if i'm incorrect in saying this but don't you need to create a NEW instance of the thumbNailImg first?
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
I'm a newbie to all this (so please bear with me ) - I found the vb version of this code on the web and attempted to rewrite as C#. I thought I was creating a new instance in this line:
System.Drawing.Image thumbNailImg = fullSizeImg.GetThumbnailImage(newWidth, newHeight, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
If not, please tell me how.
Many thanks
Lorna
|
|
|
|