|
The table has columns batch_id, task_id, seq.
One batch_id has several task_id and one task_id can have several seq.
task_id can be A, B, C or others.
I need to write a sql command that can get a table:
count(task_id when task_id = value1), count (task_id when task_id = value2),...
Can anyone help me that how to change the column value to be a column?
|
|
|
|
|
This is not relating to ASP.Net. Post the query in proper forum.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
Thanks for you answer and your reminding.
|
|
|
|
|
Hi,
In my application i have a form where in which when i submit the form by clicking on the submit button it will do some operation .This operation has to be performed only once so i have disabled that button once it gets clicked to avoid the multiple clicks of it by writing the code
Button1.Enabled = false;
in the button click event , this is working fine but when i am redirecting to another page after completion of the operation in that button click code , the button is not getting disabled .Because of this, even though i have disabled the button when a user clicks on the button multiple times that particular operation is getting executed the number of times the button is clicked instead only once .
here is my button click code
protected void Button1_Click(object sender, EventArgs e)
{
Button1.Enabled = false;
Response.Redirect("http://abc.com/test.apsx");
}
Please can anyone help me to resolve this problem
Thanks in advance
|
|
|
|
|
are you redirecting user to same page?
Cheers!!
Brij
|
|
|
|
|
Hi,
thanks for the reply , no i am not redirecting to the same page .I need to to redirect it other page.
Thanks
|
|
|
|
|
Your Qs is not clear.When you redirect to another page then how the button which was on earlier page is visible.
Anyways you can have a flag in session set it when user click on the button once and put your enable/disable button code on the pageload.
Cheers!!
Brij
|
|
|
|
|
Hi,
When the current page is redirecting to another page it is taking some time , in that time only user can click on the button multiple times .As you said if I use session there may be a chance of user clearing the browser sessions , if it does not happen also for the first button click i will do some operation and the result of that operation has to be sent to another page but if I use the session for the first click of the button some operation is done and trying to redirect to another page and meanwhile if user again clicks on the button i will check for the session and will not perform the same operation again but redirection will not happen in this case . Please suggest me the solution.
Thanks
|
|
|
|
|
Ok try to disable it from javascript.It should work
Cheers!!
Brij
|
|
|
|
|
Hi Brij,
Thanks for your support, I have tried it using java script and its worked for me.
I have taken a hidden field , for the first click of the button i will assign some value to that hidden field .For every hit of the button one java script function will be called and there i will check for the hidden field value , if there is any value in it i will not do anything.
|
|
|
|
|
Hi all
How to perform redirection from global.aspx.
Amit Patel
|
|
|
|
|
Amit Patel1985 wrote: How to perform redirection from global.aspx.
I guess you are talking about global.asax not aspx .
Just try with this :
Context.Response.Redirect()
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Try
Response.Redirect("Page Name");
I think it should work.
Rock Star
|
|
|
|
|
While Replying, please make sure that you are replying to a correct person. You are replying to me, but you need to reply the person who asked the question. As you are replying to me I am getting an Email notification, which is not usefull to me, but your answer may helpful to the person who asked the question. Hope you got my point.,
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
So i am making a "Delete" button, which is on a gridview. The link calls some javascript, updates the hiddenfield value and then opens a jQuery dialog. In the dialog, there is a "Yes", "No" options.
If the user clicks "Yes", i get the value of the hiddenfield and delete the record.
Button;
<a href="#" onclick='LoadDialog(<%# Eval("AccountId") %>)'>Delete</a>
Javascript;
function LoadDialog(accountId) {
$('#<%= HiddenFieldAccountId.ClientID %>').attr('value', accountId);
$('#dialog').dialog('open');
return false;
}
Dialog;
<div id="dialog" title="Delete Account">
Are you sure you wish to delete this account?<br /><br />
<asp:HiddenField ID="HiddenFieldAccountId" runat="server" />
<asp:LinkButton ID="LinkButtonDelete" runat="server" onclick="LinkButtonDelete_Click">Yes</asp:LinkButton> |
<a href="#" onclick="UnloadDialog()">No</a>
</div>
When the "Yes" (LinkButtonDelete) is clicked, i step into the code and look at the hidden field, and this is where i come to the problem. The hidden field value is empty.
I've added an alert message to the 'LoadDialog' javascript, and i know the account id is set, its just the code behind cant see it is.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
No one got any ideas?, Someone must of had to create a "Confirm" dialog in jQuery and display some data from code behind before...
Regards,
Gareth.
(FKA gareth111)
modified on Tuesday, December 29, 2009 11:06 AM
|
|
|
|
|
Problem solved. The HiddenField was always returning empty, even if i set it in the code behind. It was because it was located in a panel. Weird, not sure why, but once i moved it from one part of the page to the top (outside of the panel), it worked.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Hi All ,
I have the requirement that user is logged in from some place.
now if he again login from same id from other place i want to logout.
for this i storing value in data base of session then checking.
now if user login from another place after checking from database another confirmation message box should come user is logged in fom other place do u want to logged out this i want in java script pop up or any popup.
I am unable to display confimation message box from code behind.
Can u guys help me to solve this probs.
Thanks and regards,
Amit Patel
|
|
|
|
|
Check this[^] article. Looks like this is what you need.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi
Does anyone know free source code of the forum which is done in asp.net ? I've found several examples but they are shareware.
I want to write my own forum and I want to learn how to do it from examples.
|
|
|
|
|
|
|
Hi All,
DateTime.now.tostring("dd-mm-yyyy") it shows correct time format. but it shows server's time.i need it in IST +5:30 time Zone can you help how do display it in correct format.
|
|
|
|
|
Hope this will help you
DateTime.Now.ToUniversalTime().AddMinutes(330)
Life Is Beautiful
|
|
|
|