|
There's no event, because, what use would it be ? If the user clicked on a textbox, and the page did a postback, how is that useful ?
As someone said, any interaction on that level, needs to happen with javascript. If you put an event on your control, such as onblur, ASP.NET will not recognise it, and will just pass it verbatim to the client.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
O.K. javascript is the way to go. The only problem I see is this. I will be using a hidden field on the page to store a gridview row index value. Now, because the gridview rows contain textboxes I can get the onClick event for the textbox; however, how do I identify which gridview row (index) , in the javascript, contains the textbox?
Thanks,
Steve
|
|
|
|
|
Your method that is called can pass 'this' as a parameter ( minus quotes ). This will be the actual textbox that you clicked. If you need the whole row, you may be able to get a parent property, or you can set the Ids of the textboxes to contain a row number.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am developing a application which uses the update panel to refresh a gridview when changes are made in a dynamically loaded usercontrol which is loaded as one of the cells of the grid I am experiencing some strange issues firstly the grid is loading the control in the RowDataBound event and binding to the data in PageLoad this approach causes a problem when its time to update the data within the usercontrol due to the buttons event which updates the db fires after the PageLoad as you can determine the PageLoad will bind the grid to the db before the buttons update code as run so the changes will not get reflected. Now the problem arrises I put my data binding code as i would later on in the life cycle [onPreRender] so the button can update the db and changes will be rendered. but what happens is the buttons event handler in the control does not get triggered. but the async postback is taking place, the buttons click event works when the databinding code is in the Page_Load but but not this way in PreRender. i have had this problem for a couple of days now i dont know if its a issue with binding so late on in the cycle or related to the buttons events not getting registered.
I would much appreciate any feedback or advice.
Regards
Dan.
Dan
|
|
|
|
|
If you load a control during page load or later, then it won't exist early enough for viewstate to be restored, so no events will fire.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hello!
i'm trying to consume a web service writing by a friend in a networking environment.The web service is on the server (main) i tested it there and it is working.
the web reference was done withtout a single problem.
my code takes data from the request either post or get.
to make sure it's working i pass the data that is supposed to be collected by the request object and that one is working to.i also display the value of the querystring passed in my codewith the response.write and is all fine there too.but each time i'm passing the value to the function i see the error Nullable object must have a value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Nullable object must have a value.
Source Error:
Line 49:
Line 50:
Line 51: decimal resp = (decimal)serv.getBalance(num, pin);
Line 52: Response.Write(resp);
Line 53: Response.Write(pin);
i debug it i they are not null and have the expected value.
i'm a lilte bit lost.and have this thing done before night. So i'll to have your opinion.
what do you think guys?
this are the codes
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
string text = Request["text"];<br />
string number = Request["number"];<br />
<br />
string[] t;<br />
<br />
t = text.Split(new Char[] { ' ',',' });<br />
dreamserve.iWalletMobileBasic serv = new dreamserve.iWalletMobileBasic();<br />
if (t[0].Trim() != "")<br />
{<br />
if(t[0].ToLower() == "foo")<br />
{<br />
if(t[1].Trim() !="" && number.Trim()!="")<br />
{<br />
string num = number.Trim();<br />
string pin = t[1].Trim();<br />
decimal resp = (decimal)serv.getBalance(num, pin);<br />
Response.Write(resp);<br />
<br />
}<br />
<br />
}<br />
}<br />
}<br />
even if i use number and t[1] directly itsthe same i tough it's due to empty space,casting that why i created pin and num.i really don't know what is wrong
please if it's possible get to me as quick as possible.Thanks guys!
eager to learn
|
|
|
|
|
highjo wrote: (decimal)serv.getBalance(num, pin);
Use decimal.TryParse to convert without it ever blowing up.
highjo wrote: if (t[0].Trim() != "")
{
if(t[0].ToLower() == "foo")
{
if(t[1].Trim() !="" && number.Trim()!="")
Wow - this is messy.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi friends ,
In my current project I have to host a dropdown list in gridview control.How to do that ?.It will be very helpful if you are providing some codes or links.Thank you all in advance
|
|
|
|
|
Just include the following in your gridview:
<asp:TemplateField HeaderText="Update" Visible="true">
<ItemTemplate >
<asp:DropDownList ID="" runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
We are not a Code Charity
|
|
|
|
|
can someone help with useful code i have the following in my codebehind
Public Function GetCust() As String
Return Session("CustCode")
End Function
And this in the aspx page
<asp:Label ID="Label1" runat="server" Text=<%# GetCust() %> ></asp:Label>
Can someone please tell me how to fix this and not to do it another way as i have to implement this method. I have simplified the above to get the point across.
thanks i hope someone can help its annoying me badly..
|
|
|
|
|
You should use <%= to get a string, <%# is for data binding statements.
thedom2 wrote: Can someone please tell me how to fix this
Of course, you haven't said what needs to be fixed, so I am guessing blindly.
Anotehr thing is, don't ever do this:
thedom2 wrote: Return Session("CustCode")
If you can't factor out all session access to a class, at LEAST store things like CustCode as constants, so you don't get a weird bug b/c somewhere else you typed Custcode instead.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi all!
I had a doubt , Does images will be compressed while storing images in to the database?
iam using file upload control to upload the images into the database.
while uploading iam converting the image into byte streem.
AND ALSO TELL ME WHAT IS THE COMPRESSION RATIO(IF COMPRESSED).
AND TELL ME WHAT IS THE DEFAULT IMAGE SIZE IN SQL SERVER?
PLEASE GIVE ME THE INFORMATION.
raj
|
|
|
|
|
If I were you, I would store the file location of the images rather then the actual images in the datavbase. You will very quickly find that your database size balloons.
Im not sure if it compresses them, my guess is they wont compress
We are not a Code Charity
|
|
|
|
|
.netman wrote: If I were you, I would store the file location of the images rather then the actual images in the datavbase
Definately the best way. Also saves the work of getting them back out of the database and displaying them.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
No they don't. You would have to run your own compression method on the byte stream before stored into the db and reverse for retrieving them.
|
|
|
|
|
rubobby wrote: Does images will be compressed while storing images in to the database?
The data that you store in the database will not be compressed, but for most common image formats (like jpeg, gif and png) the data is already compressed so you don't need any further compression.
rubobby wrote: PLEASE GIVE ME THE INFORMATION.
Stop screaming.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi.
First of all I think that I have to let you know that I never made any page in ASP.NET
We are running a XML based site on the local network and I will create a feedback form with XSL.
We have ASP.NET 2.0 running on another network server and I'm thinking of making a script that can send the mail from the form.
But I have no idea if this works?
How do I catch the data from the form?
The form method is POST.
|
|
|
|
|
Phrone wrote: First of all I think that I have to let you know that I never made any page in ASP.NET
I guess you want to send simple e-mail using .net, try this:
http://www.aspheute.com/english/20000918.asp
We are not a Code Charity
|
|
|
|
|
That part is no problem, but I will use System.Net.Mail instead of System.Web.Mail that you linked to.
But how do I catch the POST variables in ASP.NET?
In PHP I can get them with $_POST['myFormField'] and I suppose that there are some way to get them in ASP.NET (C#) also.
|
|
|
|
|
hi frnds. I want to have a multiple columns in drop down box. It must give look of gridview in dropdowndox.........................
no shortcuts ..................like
select id + ' ' + name as idname from.............then binding
or value1 + value2 into dropdown box ...............................any one plz get some code...................plz try for c# if not possible then vb.net .........thnks a lot guyz ....................
|
|
|
|
|
cant do this, Ive tried putting multiple columns in a dropdown and never found a way to do it.
We are not a Code Charity
|
|
|
|
|
But i found some articles they have given some way i implement it its not working ............................thanks a lot for ur concern
Thanks & Regards
Manish Singhal
Software Engineer
Maxworth systems(Delhi)
|
|
|
|
|
hlnkPhoto.Attributes.Add("onclick", "openwin('ZoomTemplates.aspx?TemplateId=" + dtTemplate.Rows[TblRowCnt]["StandardTemplateId"].ToString() + "&Type=Standard');");
hlnkPhoto.NavigateUrl = "#";
It is working fine means opening popup window but when I use above code in popup page then it is not opening popup page again.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Do you just want to refresh the same page again?
What are you trying to achieve?
We are not a Code Charity
|
|
|
|