asp.net drop downlist value reset on button click within jquery dialog
I have a div , within which I have a button and an asp.net dropdownlist. I
can change the value in the dropdownlist . But as soon as the button is
clicked the value in the drop down list is again set to the default
initial value. Is there a way I can solve this problem ? I do not want the
dropdownlist to go back to its initial value.
aspx
<div id='one'>
<asp:LinkButton ID="ConfigureAlerts"
OnClick="btnConfigureAlerts_Click" runat="server">Configure
Alerts</asp:LinkButton>
</div>
<div id="ViewModalPopupDiv2">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:Panel ID="Panel2" runat="server"
HorizontalAlign="left" ScrollBars="Auto">
<asp:Button ID="btnGetLogs" runat="server"
Text="SendAlerts" OnClick="btnSendAlertEmail_Click"/>
<asp:Label ID="Label2" runat="server" Text="Set The Alert Email Interval
to every :" CssClass="label"
ForeColor="Black"></asp:Label>   
<asp:DropDownList ID="ddlTimeInterval" runat="server" >
<asp:ListItem Text="15MIN"
Value="15"></asp:ListItem>
<asp:ListItem Text="30MIN"
Value="30"></asp:ListItem>
<asp:ListItem Text="1Hr"
Value="60"></asp:ListItem>
<asp:ListItem Text="2Hrs"
Value="120"></asp:ListItem>
<asp:ListItem Text="8Hrs"
Value="480"></asp:ListItem>
<asp:ListItem Text="24Hrs"
Value="1440"></asp:ListItem>
<asp:ListItem Text="48Hrs"
Value="2880"></asp:ListItem>
</asp:DropDownList>
<br />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
javascript
function ViewModelPopup2() {
$("#ViewModalPopupDiv2").dialog({
scrollable: true,
width: 800,
modal: true
});
}
ASPX.CS
protected void btnSendAlertEmail_Click(object sender, EventArgs e)
{
// Code to send email
}
protected void btnConfigureAlerts_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript
(this, this.GetType(), "callScriptFunction",
"ViewModelPopup2();", true);
}
}
Wednesday, 11 September 2013
Joining 2 tables where table2 contains multiple rows for each table1 row
Joining 2 tables where table2 contains multiple rows for each table1 row
I'm either over-thinking this or my SQL skills are lacking. I need to add
two columns to a table from a second table, but the values are in separate
rows in the second table. What SQL would do this? Here's an example.
transnum is the common column between the tables.
TABLE1
------
transnum id
9287 006
5782 004
5819 001
TABLE2
------
transnum code value
9287 A 198.38
9287 B 928.57
9287 C 568.25 -- code C values not needed
5782 A 219.53
5782 B 591.11
5782 C 852.32
5819 A 109.92
5819 B 251.81
5819 C 295.12
DESIRED RESULT
--------------
transnum id valueA valueB
9287 006 198.38 928.57
5782 004 219.53 591.11
5819 001 109.92 251.81
I'm either over-thinking this or my SQL skills are lacking. I need to add
two columns to a table from a second table, but the values are in separate
rows in the second table. What SQL would do this? Here's an example.
transnum is the common column between the tables.
TABLE1
------
transnum id
9287 006
5782 004
5819 001
TABLE2
------
transnum code value
9287 A 198.38
9287 B 928.57
9287 C 568.25 -- code C values not needed
5782 A 219.53
5782 B 591.11
5782 C 852.32
5819 A 109.92
5819 B 251.81
5819 C 295.12
DESIRED RESULT
--------------
transnum id valueA valueB
9287 006 198.38 928.57
5782 004 219.53 591.11
5819 001 109.92 251.81
Eclipse wont generate R file after ADT 22 Update
Eclipse wont generate R file after ADT 22 Update
I recently updated to ADT 22.0.5 and now my projects wont generate the R
file. I have followed all steps posted in other questions and still have
no luck. Any suggestions? I have lost way to much time on this.
I recently updated to ADT 22.0.5 and now my projects wont generate the R
file. I have followed all steps posted in other questions and still have
no luck. Any suggestions? I have lost way to much time on this.
CUDA - Precision difference in Release version between with and without debug information
CUDA - Precision difference in Release version between with and without
debug information
I have a CUDA application, which I compile once for a Release version
twice: once with debug info (-G used) and once without debug info. I run
the application which does some computations on floats (including
functions such as expf, sinf, cosf, etc.). I notice that there are slight
differences in the numbers created by the two versions, here they are side
by side:
0: (-8.000000,0.000000,0.000000) 0: (-8.000000,0.000000,0.000000)
1: (-8.212574,-0.112065,0.970697) 1: (-8.212575,-0.112065,0.970697)
2: (-8.365530,-0.250361,1.949206) 2: (-8.365531,-0.250361,1.949206)
3: (-8.332600,-0.251884,2.948662) 3: (-8.332601,-0.251885,2.948662)
4: (-8.593035,-0.619825,3.841295) 4: (-8.593036,-0.619826,3.841295)
5: (-8.507285,-0.778658,4.824870) 5: (-8.507286,-0.778658,4.824870)
6: (-8.441058,-1.001207,5.797539) 6: (-8.441058,-1.001207,5.797539)
7: (-8.680929,-1.051136,6.767059) 7: (-8.680929,-1.051136,6.767059)
These are the first 7 values (both versions start with -8,0,0). As you can
see at this point there are only small differences in the 6th digit after
the decimal point. However, I use these during rotation matrix
computation, so after 1000 of these, the differences add up to be quite
significant.
I'm not adding the source code because it is very big and quite complicated.
I was wondering why is there a difference in the first place. I know that
there are vast differences between debug and release versions in terms of
optimizations. I guess there are similar differences between release with
and without debug info. However, how could optimizations change
calculation precision?
debug information
I have a CUDA application, which I compile once for a Release version
twice: once with debug info (-G used) and once without debug info. I run
the application which does some computations on floats (including
functions such as expf, sinf, cosf, etc.). I notice that there are slight
differences in the numbers created by the two versions, here they are side
by side:
0: (-8.000000,0.000000,0.000000) 0: (-8.000000,0.000000,0.000000)
1: (-8.212574,-0.112065,0.970697) 1: (-8.212575,-0.112065,0.970697)
2: (-8.365530,-0.250361,1.949206) 2: (-8.365531,-0.250361,1.949206)
3: (-8.332600,-0.251884,2.948662) 3: (-8.332601,-0.251885,2.948662)
4: (-8.593035,-0.619825,3.841295) 4: (-8.593036,-0.619826,3.841295)
5: (-8.507285,-0.778658,4.824870) 5: (-8.507286,-0.778658,4.824870)
6: (-8.441058,-1.001207,5.797539) 6: (-8.441058,-1.001207,5.797539)
7: (-8.680929,-1.051136,6.767059) 7: (-8.680929,-1.051136,6.767059)
These are the first 7 values (both versions start with -8,0,0). As you can
see at this point there are only small differences in the 6th digit after
the decimal point. However, I use these during rotation matrix
computation, so after 1000 of these, the differences add up to be quite
significant.
I'm not adding the source code because it is very big and quite complicated.
I was wondering why is there a difference in the first place. I know that
there are vast differences between debug and release versions in terms of
optimizations. I guess there are similar differences between release with
and without debug info. However, how could optimizations change
calculation precision?
Is C compiler a pure form of compilers
Is C compiler a pure form of compilers
Can a compiler build using C be called a pure form of compiler.
Is there anything related to I/O systems that makes C not a pure compiler.
for example
printf("%s=%d" , "x" , 10)
How does C compiler interprets this?
Can a compiler build using C be called a pure form of compiler.
Is there anything related to I/O systems that makes C not a pure compiler.
for example
printf("%s=%d" , "x" , 10)
How does C compiler interprets this?
Tuesday, 10 September 2013
Add jquery to a html element that is added dynamically.
Add jquery to a html element that is added dynamically.
I have <video> elements added to the page when an image is clicked. A
light box with the video pops up. What would be the best way to execute a
snippet of jquery to this dynamic video element? I though maybe some form
of the .on method might work was not sure.
I have <video> elements added to the page when an image is clicked. A
light box with the video pops up. What would be the best way to execute a
snippet of jquery to this dynamic video element? I though maybe some form
of the .on method might work was not sure.
Jquery's eq(0), "..first-child", first() not grabbing first child if its an iframe
Jquery's eq(0), "..first-child", first() not grabbing first child if its
an iframe
Basically I need to grab the first child of a parent element, usually but
not limited to an <iframe>.
<div>
<iframe src="www.asource.com">GRAB THIS AFTER A BUTTON IS
CLICKED</iframe>
</div>
I have tried the following
$("#parent").eq(0).prop("tagName");
$("#parent").first().prop("tagName");
$("#parent:first").prop("tagName");
$("#parent:nth-child(1)").prop("tagName");
$("#parent:lt(1)").prop("tagName");
All of these return a "div" when I alert them. The reason I am getting the
prop name was because I wanted to use the find() to get the element.
$("parent").find(ONE OF THE PROP CALLS ABOVE).animate({.....
because when I do:
$("parent").find('**iframe**').animate({.....
that is the only scenario that I can grab and properly animate an iframe.
however since we don't know if the first child is an iframe or not, i used
.prop() to get the first element tag name and find it. (please note, i
tried all the above attempts directly with .animate(...) instead of
.prop(...) but that also didn't grab the iframe. Would really appreciate
some guidance
an iframe
Basically I need to grab the first child of a parent element, usually but
not limited to an <iframe>.
<div>
<iframe src="www.asource.com">GRAB THIS AFTER A BUTTON IS
CLICKED</iframe>
</div>
I have tried the following
$("#parent").eq(0).prop("tagName");
$("#parent").first().prop("tagName");
$("#parent:first").prop("tagName");
$("#parent:nth-child(1)").prop("tagName");
$("#parent:lt(1)").prop("tagName");
All of these return a "div" when I alert them. The reason I am getting the
prop name was because I wanted to use the find() to get the element.
$("parent").find(ONE OF THE PROP CALLS ABOVE).animate({.....
because when I do:
$("parent").find('**iframe**').animate({.....
that is the only scenario that I can grab and properly animate an iframe.
however since we don't know if the first child is an iframe or not, i used
.prop() to get the first element tag name and find it. (please note, i
tried all the above attempts directly with .animate(...) instead of
.prop(...) but that also didn't grab the iframe. Would really appreciate
some guidance
Subscribe to:
Posts (Atom)