Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
4,034,322 | 4,034,323 |
Jquery slider value not zero
|
<p>You can see the code live here: <a href="http://jsfiddle.net/z3xV3/50/" rel="nofollow">http://jsfiddle.net/z3xV3/50/</a></p>
<p>My HTML:</p>
<pre><code><div id="slider"></div>
<input id="sliderValue" />
<div id="boksTimer"></div>
</code></pre>
<p>My JQUERY:</p>
<pre><code>$(document).ready(function() {
$("#slider").slider({value:'',min: 0,max: 150,step: 0.5, range: 'min',
slide: function( event, ui ) {
$( "#amount" ).html( ui.value + ' timer');
$('#sliderValue').val(ui.value);
}
});
var thumb = $($('#slider').children('.ui-slider-handle'));
setLabelPosition();
$('#slider').bind('slide', function () {
$('#boksTimer').html(((($('#slider').slider('value')) / 31) * 60).toFixed(0) + 'min pr. dag');
setLabelPosition();
});
function setLabelPosition() {
var label = $('#boksTimer');
label.css('top', '20px');
label.css('left', thumb.offset().left - (label.width() - thumb.width())/ 2);
}
});
</code></pre>
<p>Why is the value of the boksTimer 1min pr. day when the slider is at 0 ? </p>
|
javascript jquery
|
[3, 5]
|
1,527,746 | 1,527,747 |
How to overwrite (NOT append) a text file in ASP.NET using C#
|
<p>I have included a text file in my website with multiple lines.
I have put a textbox (Multimode=true) and a button in the page.
On Page_Load the content from the textFile should be displayed in the textbox.
Then the user can edit the textbox. On button click the current content of TextBox should be overwritten in that text file (it should not be appended).</p>
<p>I'm successfully displaying the text file data in a textbox. But while overwriting, it appends in the text file rather than overwriting.</p>
<p>This is my code:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (File.Exists(Server.MapPath("newtxt.txt")))
{
StreamReader re = new StreamReader(Server.MapPath("newtxt.txt"));
while ((input = re.ReadLine()) != null)
{
TextBox1.Text += "\r\n";
TextBox1.Text += input;
}
re.Close();
}
else
{
Response.Write("<script>alert('File does not exists')</script>");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
StreamWriter wr = new StreamWriter(Server.MapPath("newtxt.txt"));
wr.Write("");
wr.WriteLine(TextBox1.Text);
wr.Close();
StreamReader re = new StreamReader(Server.MapPath("newtxt.txt"));
string input = null;
while ((input = re.ReadLine()) != null)
{
TextBox1.Text += "\r\n";
TextBox1.Text += input;
}
re.Close();
}
</code></pre>
<p>How can I overwrite the text file and then display it in my TextBox on the same button click?</p>
|
c# asp.net
|
[0, 9]
|
433,060 | 433,061 |
Javascript - Object loses its value on function exit
|
<p>I've got this strange problem. In my code, I have a variable named <code>val1</code> which gets a value after a jQuery call, but after exiting the jQuery function it loses its value.</p>
<p>Here's the code:</p>
<pre><code>var val1;
$.getJSON('some address', null, function (result) {
val1 = result.names[0].name;
alert(val1); //first alert
});
alert(val1); // second alert
</code></pre>
<p>On first alert, I get the needed value, but on the second Alert - I get <code>undefined</code>.</p>
<p>Why?</p>
|
javascript jquery
|
[3, 5]
|
3,560,444 | 3,560,445 |
jQuery issue in IE
|
<p>Hello I'm using this function as an address book module, for selecting any employee from the sidebar it display all the content of the employee. It works fine in Chrome but not in IE. I'm not able to run the src variables declared in this function in IE. Please suggest me some other ways to declare these type of variables so that these will be compatible to all browsers.</p>
<pre><code>function singleSelect(id)
{
if(flag){
unCheckAll();
userIds="";
//userIds= document.forms['frmSidebarSearch'].elements['userIds'].value + id +",";
var src = ($("#"+id).attr("src") === "<@core.basePath/>images/chk-box-img.gif")
? "<@core.basePath/>images/chk-box-img-tick.gif"
: "<@core.basePath/>images/chk-box-img.gif";
$("#"+id).attr("src",src);
var src2 = ($("#anchor"+id).attr("class") === "")
? "selected"
: "";
$("#anchor"+id).removeClass().addClass(src2);
var elementss = document.getElementById("all").getElementsByTagName('img');
for(i=0;i<elementss.length;i++) {
if($("#"+elementss[i].id).attr("src") === "<@core.basePath/>images/chk-box-img-tick.gif"){
userIds= userIds +"," +elementss[i].id;
}
}
unHilightAll();
highLightIndex(id);
document.forms['frmSidebarSearch'].elements['userIds'].value=userIds;
$('#frmSidebarSearch').ajaxSubmit({target:'#content',url:'<@core.basePath/>sp/manager/manageraddressbook/manager/'+id});
}
flag = true;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,279,985 | 2,279,986 |
Checkbox to Control Button Enabled Property - ASP.NET
|
<p>I would like to know how I can control the 'Enabled' property of a button based on the 'checked' value of a checkbox:</p>
<pre><code><asp:CheckBox ID="chkEnableButton" runat="server" />
<asp:Button ID="btnLoadForm" runat="server" />
</code></pre>
<p>I can do this very easily on the server side - but I require this to be done on client side only, meaning JavaScript. Would the OnCheckedChanged attribute allow me to call some JavaScript to do this....or is it strictly for calling a handler in the code-behind?</p>
<p>Just to clarify, when the checkbox is checked, the button is enabled... when the checkbox is unchecked the button is disabled.</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
4,900,518 | 4,900,519 |
How to convert this jquery code to "raw" javascript
|
<p>Can someone help me convert this jquery code into javascript (that doesn't require the jquery library)?</p>
<pre><code>var console={
panel:$(parent.document.body),
log:function(m){
this.panel.find("#something").append(m)
}
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,087,195 | 5,087,196 |
Changing an ID using JQuery
|
<p>I'm trying to change the ID of an element here:</p>
<p><a href="http://moemonty.com/chirp/CHIRP-JSON-test.html" rel="nofollow">http://moemonty.com/chirp/CHIRP-JSON-test.html</a></p>
<p>By using this line:</p>
<pre><code>$('.databaseID').attr('id', 'test');
</code></pre>
<p>I would like to change the id of this line to test, so I can proceed to put in a pre-fix via a string and a variable from JSON data. But for now, I just wanted to see if I could replace it with test at this line:</p>
<pre><code><li class="databaseID" id="np-44701">
</code></pre>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
887,634 | 887,635 |
jquery id getting help
|
<p>i want to put the id into the colorbox below this code nom works but the page with the link on it is </p>
<pre><code>$("#recent_activity").load("activity.php?id="+id+"&random=" +unique_requestid());
</code></pre>
<p>thats how it calls the page and the link is on that page.</p>
<pre><code>var id = $.query.get('id');
$("a[href='write_comment.php?act=write&id="+id+"']").colorbox({width:"500", height:"350", iframe:true});
</code></pre>
<p>thank you</p>
|
javascript jquery
|
[3, 5]
|
2,373,715 | 2,373,716 |
how to make a process run on iis?
|
<p>Dear all, i have following code to open a file on click of a button</p>
<blockquote>
<p>System.Diagnostics.Process.Start("soffice.exe",filepath);</p>
</blockquote>
<p><strong>soffice.exe</strong> is to open .odt files & <strong>filepath</strong> is containing the complete path of the file which i want to open.</p>
<p>This is working perfectly when i m executing the code on my local system, but as i m hosting it on the iis server (<strong>5.1</strong>), its not taking any action (event not throwing any error too). <strong>My filepath is accessing a folder in my project, not outside.</strong> Kindly suggest the possible reasons and solutions</p>
|
c# asp.net
|
[0, 9]
|
2,136,949 | 2,136,950 |
data manipulate on tree structure by jQuery
|
<p>Below is tree structure and i want to have second tree structure by jquery.</p>
<pre><code><ul>
<li data-id="1">
<ul>
<li data-id="2">
<ul>
<li data-id="6"></li>
</ul>
</li>
</ul>
</li>
<li data-id="3"></li>
<li data-id="4"></li>
</ul>
</code></pre>
<p>this is destination structure that i want to have so how can i do that ?</p>
<pre><code><ul>
<li data-id="1" data-path="1">
<ul>
<li data-id="2" data-path="1,2">
<ul>
<li data-id="6" data-path="1,2,6"></li>
</ul>
</li>
</ul>
</li>
<li data-id="3" data-path="3"></li>
</ul>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,872,009 | 2,872,010 |
Test if a DOM element or JSON
|
<p>Suppose a function accepts one argument that is whether a DOM element or JSON that are wrapped in jQuery object or not, so how to tell one from the other?</p>
|
javascript jquery
|
[3, 5]
|
2,091,594 | 2,091,595 |
alert shows undefined in javascript when passed value form aspx.cs page
|
<pre><code> string locationName = "Mumbai";
Page.ClientScript.RegisterStartupScript(Type.GetType
("System.String"), "addScript", "PassValues(" + locationName + ")", true);
</code></pre>
<p>in javascript my code contains</p>
<pre><code><script language="javascript" type="text/javascript">
function PassValues(locationName)
{
var txtValue = locationName;
alert(txtValue);
}
</script>
</code></pre>
<p>Here the alert shows undefined instead of "Mumbai" </p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,146,396 | 1,146,397 |
How to use the select menu value in the specific DIV jQuery
|
<p>I have the following code to get the selected item value and post it to a DIV. That is okay, it is working fine, my DIV shows the selected value. But my question is how can I use that value in the DIV ? so that I can create a php msyql query.</p>
<pre><code><head>
<style>
.response {
padding:10px;
background-color:#9F9;
border:2px solid #396;
margin-bottom:20px;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
$("#developer").change(onSelectChange);
});
function onSelectChange(){
var selected = $("#developer option:selected");
var output = "";
if(selected.val() != 0){
output = selected.val();
}
$("#output").html(output);
$('#output').slideDown("slow");
}
</script>
</head>
<select id="developer">
<option value="0">Select</option>
<option value="1">name</option>
<option value="2">name2</option>
</select>
<div align=center class=response id=output style="display:none;">
<?php
$sql = "SELECT * FROM users WHERE name='$name'";
$result = mysql_query($sql) or die("err");
while($row=mysql_fetch_array($result)){
$age = $row[age]; }
echo $age;
?>
</div>
</code></pre>
|
php jquery
|
[2, 5]
|
1,620,636 | 1,620,637 |
what's the different between live and delegate
|
<p>like the title said , this two function is in jquery :)</p>
|
javascript jquery
|
[3, 5]
|
2,473,830 | 2,473,831 |
difference between timer and alarmmanager
|
<p>I am a bit confused about <code>Timer</code> and <code>AlarmManager</code> used in Android. </p>
<p><em>What are the main differences between them</em>? </p>
<p>They are both scheduling a task to run at every A seconds. And what is the main scenario that they are preferred to be used?</p>
<p>For example, for X situation, use <code>Timer</code> but on the other hand, for Y situation, use <code>AlarmManager</code>.</p>
|
java android
|
[1, 4]
|
2,599,682 | 2,599,683 |
Implementing option menu one time for several activities
|
<p>I am trying to implement an options menu for my app and the same menu is used in different activities. In the <a href="http://developer.android.com/guide/topics/ui/menus.html" rel="nofollow">Android developers site</a>, it says the following:</p>
<blockquote>
<p>Tip: If your application contains multiple activities and some of them
provide the same options menu, consider creating an activity that
implements nothing except the onCreateOptionsMenu() and
onOptionsItemSelected() methods. Then extend this class for each
activity that should share the same options menu. This way, you can
manage one set of code for handling menu actions and each descendant
class inherits the menu behaviors. If you want to add menu items to
one of the descendant activities, override onCreateOptionsMenu() in
that activity. Call super.onCreateOptionsMenu(menu) so the original
menu items are created, then add new menu items with menu.add(). You
can also override the super class's behavior for individual menu
items.</p>
</blockquote>
<p>My activities extend from Activity, ListActivity or MapActivity, so what would be the correct way to implement what they are suggesting here? is it possible? Because I cannot extend this new class for all of these, I could only do something like public abstract BaseMenu extends Activity (as explained in <a href="http://stackoverflow.com/questions/4894116/adding-the-same-context-menu-to-multiple-activities">this question</a>) but this doesn't work for me. So I am wondering if there is a work around I can implement.</p>
<p>Thanks in advance</p>
|
java android
|
[1, 4]
|
3,740,785 | 3,740,786 |
jquery insert-before to text in the same DOM
|
<p>Hi I'm working on inserting a text to this DOM but my try did not work like I expecting.</p>
<pre><code> <p class="doing">Peter are <a href="mysite.com">here</a></p>
<script>$("p.doing").before("I and ");</script>
</code></pre>
<p>I'm expecting to have result:</p>
<pre><code><p class="doing">I and Peter are <a href="mysite.com">here</a></p>
</code></pre>
<p>but it was :</p>
<pre><code>I and
<p class="doing">Peter are <a href="mysite.com">here</a></p>
</code></pre>
<p>Please kindly advise how to solve this.</p>
|
javascript jquery
|
[3, 5]
|
5,839,077 | 5,839,078 |
Are there any good reasons NOT to use jQuery instead of plain old JavaScript?
|
<p>I recently discovered jQuery, and I can immediately see how useful and elegant it is.</p>
<p>I'm curious, though - are there any reasons NOT to use it (and just use plain old JavaScript instead)? If there aren't any reasons, should it not be integrated fully into the JavaScript language?</p>
|
javascript jquery
|
[3, 5]
|
33,526 | 33,527 |
How do I render User Control children at a specific location?
|
<p>I have a very simplistic user control that looks like this:</p>
<pre><code><%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wfWindow.ascx.cs" Inherits="webfanatix.co.za.wfWindow" %>
<div>Just a test...[x]</div>
</code></pre>
<p>with this code behind:</p>
<pre><code>[ParseChildren(false)]
[PersistChildren(true)]
public partial class wfWindow : System.Web.UI.UserControl
{
protected override void Render(HtmlTextWriter writer)
{
RenderChildren(writer);
}
}
</code></pre>
<p>And the usage thereof looks like this:</p>
<pre><code><wf:wfWindow runat="server">This content should go where [x] is.</wf:wfWindow>
</code></pre>
<p>I'm no ASP.NET pro, so how do I get the content to render exactly where the [x] appears in my user control?</p>
<p>RenderChildren is rendering my content, but it is only appended to the end of the UserControl output. I need it to go and sit right where [x] marks the spot.</p>
<p>Thanks in advance!</p>
|
c# asp.net
|
[0, 9]
|
4,878,881 | 4,878,882 |
What is the right way to load the values from the database to label?
|
<h2>Admin.aspx</h2>
<pre><code> <div id="valueIntroduction" class="labelarea" runat="server"> </div>
<div class="line"></div>
</code></pre>
<h2>Admin.aspx.cs</h2>
<pre><code> SqlConnection NewConn = new SqlConnection(ConfigurationManager.ConnectionStrings["SoicConnection"].ConnectionString);
NewConn.Open();
SqlCommand NewComm = new SqlCommand();
SqlCommand NewComm1 = new SqlCommand();
if (Department.Items[0].Selected)
{
firstPanel.Visible = true;
myLegend.InnerText = "Informatics";
NewComm.CommandText = "getTextHeaderINFO";
NewComm.CommandType = CommandType.StoredProcedure;
NewComm.Connection = NewConn;
NewComm.CommandTimeout = 3000;
SqlDataReader results = NewComm.ExecuteReader();
while (results.Read())
{
Response.Write(results["TEXT_CONTENT"].ToString());
Label valueIntroduction = results["TEXT_CONTENT"];
}
}
</code></pre>
<p>What I am exactly tryting is to get the value from database and loading it into a label. I am new to .net and stackoverflow. Sorry incase if I dont know how to use this forum properly.</p>
|
c# asp.net
|
[0, 9]
|
4,911,927 | 4,911,928 |
Basic 2 image slideshow in Jquery
|
<p>I'm trying to create a basic jquery 2 image slideshow. I don't want the images to fade into eachother, they should just simply change every second.
In the jquery code I have below, the code includes fading. What would be the correct code without fading?</p>
<pre><code><div id="manwrapper">
<div>
<img src="images/index-man.png" width="500" height="788" alt="SS Image" />
</div>
<div>
<img src="images/index-man2.png" width="500" height="788" alt="SS Image" />
</div>
</div>
<!--end manwrapper-->
</code></pre>
<h1>CSS</h1>
<pre><code>#container #manwrapper {
float: right;
margin-top: -280px;
z-index: 3;
position:relative;
width:500px;
height:788px;
}
#container #manwrapper > div {
position:absolute;
}
</code></pre>
<h1>JavaScript</h1>
<pre><code>setInterval(function () {
$('#manwrapper > div:first')
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo('#manwrapper');
}, 3000);
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,612,354 | 3,612,355 |
How to tell if a function is blank?
|
<p>I am writing a web app (and honestly I dont know what I would do without stackoverflow), but here is what I am doing. </p>
<p>My users can define custom functions, Well right off the bat someone pointed out to me there should be a way to warn the user that the function is blank.</p>
<p>for example a user may write his function to look like this</p>
<pre><code>cFunctionRun: function () {}
</code></pre>
<p>Sadly I have no control over how a function is created which means this very well could happen.</p>
<p>So now I have to find a way to tell the user that this function wont do anything, because well there is nothing it can do. If this is impossible that is fine, but I thought it wouldn't hurt to ask.</p>
<p>For more information on the cFunctionRun part check out this stackOverflow question <a href="http://stackoverflow.com/questions/14738154/jquery-bind-custom-function-to-appended-element/14738582">jQuery bind custom function to appended element</a></p>
|
javascript jquery
|
[3, 5]
|
2,259,429 | 2,259,430 |
how to use alert in php and js combined
|
<p>have a need to alert through php,<br>
I have the code below. Problem is that it works as long as I dont use header redirect. But as soon as I use it..I loose alert.</p>
<pre><code>echo "I will do some functions here in php";
if($value == 1){
alert('ok working');
}
header(location: 'someOtherpagethanthis.php');
</code></pre>
|
php javascript
|
[2, 3]
|
4,606,986 | 4,606,987 |
ASP.NET C# - A function with arguments to write dropdownlist
|
<p>I am new to ASP.NET and C#. </p>
<p>What I am trying to do is some type of function where I can feed some argumennts, which will generate a dropdown list box for me. I know ASP.NET is much better, but I couldn't figure out how to accomplish similar or even better.</p>
<p>When I've done before with classic ASP/VBScript was I have a Sub routine to generate a dropdown list.
Example:</p>
<pre><code>Sub CreateSelectBox(selectboxID, onChangeTrigger, selectedValue, SQLTable, and SQLCondition)
' ... Query the databse from SQLTable, write a SelectBox with option values, and selected the selectedValue for arguments....
End Sub
</code></pre>
<p>So, all I have to do in the any submit form is just one line of code. like this:</p>
<pre><code><tr><td><%CreateSelectBox "DropDownList1", "onChangeRunJavascript123();", "Selected123", "SQL_CustomerTable", "where CustomerType = 'Consumer' order by SortOrder ASC" %></td></tr>
</code></pre>
<p>Please advise a better way to do this in ASP.Net C#, please provide a code sample if possible since I am new.</p>
<p>Thanks in advance,</p>
|
c# asp.net
|
[0, 9]
|
5,946,494 | 5,946,495 |
Open a window behind the current window using Javascript/jQuery
|
<p>I want to open a window on click, but I want to open it behind the current window, or when the new window opens it should minimize itself. I have made a function but it actually did not work.</p>
<pre><code><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function wn(){
var mm=window.open('http://www.google.com','newwindow','width=200, height=200', "_blank");
}
</script>
</head>
<body>
<a href="#" onclick="wn()">click</a>
</body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
823,932 | 823,933 |
interface type method parameter implementation c#
|
<p>Is it possible to do like this </p>
<pre><code>interface IDBBase {
DataTable getDataTableSql(DataTable curTable,IDbCommand cmd);
...
}
class DBBase : IDBBase {
public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd) {
...
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,001,197 | 1,001,198 |
PHP packing some data
|
<p>c++ struct:</p>
<pre><code>struct Data {
unsigned char a;
unsigned char b;
unsigned char c;
UCHAR result;
short Number;
char Id[10];
int Admin;
int Blocked;
char Proj[13];
};
</code></pre>
<p>I maked this with php:</p>
<pre><code>pack("C4sc10iic13", /** **/);
</code></pre>
<p>but it's not correct. I think</p>
|
php c++
|
[2, 6]
|
20,856 | 20,857 |
Why do Android callback methods' name start with 'on'?
|
<p>I'm just curious. (Maybe not only in Android)</p>
|
java android
|
[1, 4]
|
4,619,303 | 4,619,304 |
How to get print screen data
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/757675/website-screenshots-using-php">Website screenshots using PHP</a><br>
<a href="http://stackoverflow.com/questions/6333814/how-does-the-paste-image-from-clipboard-functionality-work-in-gmail-and-google-c">How does the paste image from clipboard functionality work in Gmail and Google Chrome 12+?</a> </p>
</blockquote>
<p>Is it possible to get print screen data on JavaScript or in PHP? I've seen this feature in Gmail before wherein I just press print Screen or copy an image to clipboard and when I press ctrl + v it automatically paste the image on the body of the email.</p>
<p>I'm trying to do this on Gmail now but I can't make it work(I wonder why, maybe the browser that I'm using).</p>
|
php javascript
|
[2, 3]
|
906,571 | 906,572 |
Javascript inside PHP - Quote problems
|
<p>I need to include some javascript in my php file but im having difficulty with the quotes inside the javascript </p>
<p><b>This is the javascript:</b></p>
<pre><code><scripttype="text/javascript">
var sc_project = $$$$;
var sc_invisible = $;
var sc_security = "$$$$$$$";
var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www.")
document.write("<sc" + "ript type='text/javascript' src='" + scJsHost + "statcounter.com/counter/counter.js'></" + "script>");
</script>
</code></pre>
<p><b>I tried </b></p>
<pre><code>echo {
'<scripttype="text/javascript">
var sc_project = $$$$$$;
var sc_invisible = $;
var sc_security = "$$$$$$";
var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www.")
document.write("<sc" + "ript' . 'type=\'text/javascript\' src='' . ' + scJsHost + "statcounter.com/counter/counter.js'.'></" + "script>");
</script>';
}
</code></pre>
<p>Any way to have this appear on my php page?</p>
|
php javascript
|
[2, 3]
|
5,335,193 | 5,335,194 |
Get X,Y position of div
|
<p>I have 3x3 list of jQuery divs like so :</p>
<pre><code>div1 div2 div3
div4 div5 div6
div7 div8 div9
</code></pre>
<p>When a div is dragged & dropped I would like to get its X & Y position in relation to the other div elements. so if div1 is dragged to div3 position I need to retrieve the postion 0,3 which represents the new position of div1. Do I need to use a plugin ?</p>
<p>So just to need to override droppable like so and get position : </p>
<pre><code>$( ".myClass" ).droppable({ drop: function( event, ui )
{
alert('my position in relation to other divs is '+????
}
});
</code></pre>
<p>Ive added a jsFiddle : <a href="http://jsfiddle.net/aL3tr/" rel="nofollow">http://jsfiddle.net/aL3tr/</a>
Can the X & Y co-ordinate of dropped item be retrieved ? In this case Y position will always be zero.</p>
|
javascript jquery
|
[3, 5]
|
4,227,515 | 4,227,516 |
authorization via url checking
|
<p>i have a table <strong>USERS</strong> with 3 columns:
<strong>userid,username,password</strong>.</p>
<p>Then table <strong>Menu</strong> with columns: <strong>id,url,canview</strong></p>
<p>How do i check a url on page load to verify if a user is allowed to view that url in asp.net & C#?
i.e if canview = yes ,user can view, else redirect to no access page.</p>
|
c# asp.net
|
[0, 9]
|
2,779,673 | 2,779,674 |
Study Schedule Using Genetic Algorithm to be deployed as web, iphone and Android mobile app
|
<p>I am working on a study schedule using genetic algorithm as a desktop application and I know it can be made as a web application. Is it possible to make it as an iphone and Android mobile app with facebook integration (e.g. login)? Is it a good idea? </p>
|
java php iphone c++ android
|
[1, 2, 8, 6, 4]
|
2,588,727 | 2,588,728 |
Fading slideshow not cycling?
|
<p>Im trying to make a fading slideshow only I cant seem to get it to fade...</p>
<p><a href="http://jsfiddle.net/FGb6L/" rel="nofollow">http://jsfiddle.net/FGb6L/</a></p>
|
javascript jquery
|
[3, 5]
|
929,397 | 929,398 |
suggest some online compiler for c/c++
|
<p>I am developing a website for which I need an online C/C++ compiler for testing code online.</p>
<p>Is there any possible and feasible solution for this.</p>
<p>I need this compiler so that students can test their code online.</p>
<p>Thnx in avance</p>
|
php c++
|
[2, 6]
|
5,118,899 | 5,118,900 |
How to make a DIV always at the bottom of the page when scrolling
|
<p>I am using the below code to make a DIV always at the bottom of the page when scrolled. But this is not working and goes on increasing the Page height. </p>
<pre><code>var LSscrollingDiv = $("#LightSwitchMenuIt");
$(window).scroll(function(){
LSscrollingDiv
.stop()
.animate({"marginTop": ($(window).scrollTop() + $(window).height()) + "px"}, "slow" );
});
</code></pre>
<p>Please help me on this.</p>
|
javascript jquery
|
[3, 5]
|
5,407,308 | 5,407,309 |
syntax error T_PAAMAYIM_NEKUDOTAYIM!
|
<p>buy.php:</p>
<pre><code><form action="cart.php" method="post">
<?php foreach($product['varieties'] as $variety): ?>
<input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="<?php echo $variety['price'] . '_' . $variety['size']; ?>" />';
<?php end foreach; ?>
</form>
</code></pre>
<p>cart.php:</p>
<pre><code>list($aDoor, size) = split('_', $_POST['price']); // line 207
if(empty($aDoor))
{
echo("You didn't select any buildings.");
}
else
{
echo "Sum of vlues = ".array_sum($aDoor);
}
</code></pre>
<p>In cart.php there is the following syntax error:</p>
<blockquote>
<p>syntax error, unexpected ')',
expecting T_PAAMAYIM_NEKUDOTAYIM in
store/cart.php on line 207</p>
</blockquote>
<p>I am expecting in cart.php to receive the two index values size and price independetly so I can use it and CSS it where ever i want. I am expecting that with the function list() and split() the variables variety and $aDoor with the price value will able to separate this two variables to be use wherever I want in cart.php</p>
<p>Help.</p>
|
php javascript
|
[2, 3]
|
797,323 | 797,324 |
How do I use JQuery or JavaScript to remove all links in a table?
|
<p>I have a table that I would like to export to Excel but I don't want any of the hyperlinks to come through. Is that possible?</p>
<p>I noticed that something similar was being done in the thread
<a href="http://stackoverflow.com/questions/6098958/jquery-remove-images">JQuery remove images</a> but I don't thing it quite the same as what I need?</p>
<p>I would also like to keep the text within the tag if possible?</p>
<p>Example: </p>
<pre><code><table class="surveyTable" id="Summary">
<tr>
<th>Section</th>
<th title="3584">
<a href="test.php?id=3584">
Call 1
</a>
</th> ...
</code></pre>
<p>I would like to have the ability to export the above without the href yet retaining the "Call 1" but maybe this is not possible?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,907,034 | 3,907,035 |
Append 'Read More' link after a certain number of characters and hide the rest
|
<p>In jQuery how can I append a "Read More" link after about 162 char's, hide the rest and once the read more link is clicked, show it, clicked it... hide it.</p>
<p>I've looked at other questions, but the answers are having another div that has the rest of the text in it. I don't want to do that, really.</p>
<p>I am trying to a paragraph of text, thats all. </p>
<pre><code><p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
</p>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,568,070 | 1,568,071 |
How should I initialize jQuery?
|
<p>I have seen this (I'm also using it):</p>
<pre><code>$(document).ready(function(){
// do jQuery
})
</code></pre>
<p>and also this (I have tried lately):</p>
<pre><code>(function(){
// do jQuery
})(jQuery)
</code></pre>
<p>both works fine.<br />
My question is what is the difference of the two ( except on how it looks ).<br />
Which one is more proper to use?.<br />
Can you give me some pro's and con's for each?<br />
Is there also another way of doing this?<br />
(also help me with the title above. SO suggested, "The question you're asking appears subjective and is likely to be closed.")<br />
Thanks everyone.</p>
|
javascript jquery
|
[3, 5]
|
1,769,369 | 1,769,370 |
Whether it is fine to use class name like UserCreate or CreateUser?
|
<p>I need to use a class name of one application. I need to ask whether I can use a class name like UserCreate or CreateUser.</p>
|
c# java
|
[0, 1]
|
1,456,864 | 1,456,865 |
How to pass TextBox value to DynamicPopulateExtender query?
|
<p>Hi I am trying to do DynamicPopulate on DropDownList2 when the value of textbox2 changes, how can I pass the value to TextBox2 to the sql query of DynamicPopulate. </p>
<pre><code><asp:DropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource1"
onselectedindexchanged="DropDownList2_SelectedIndexChanged">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MYDB %>"
SelectCommand="SELECT Time FROM Tour WHERE (Date = TextBox2 )">
</asp:SqlDataSource>
<asp:DynamicPopulateExtender ID="DropDownList2_DynamicPopulateExtender"
runat="server" Enabled="True" PopulateTriggerControlID=""
TargetControlID="DropDownList2">
</asp:DynamicPopulateExtender>
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,697,576 | 3,697,577 |
Data option change isn't picked by jquery
|
<p>I've got div like this :</p>
<pre><code><div id="something-1" data-options='{"pause":"YES","delete":"NO", "kill":"NO"}'></div>
</code></pre>
<p>What I got going on is some ajax request and changes the data options like this :</p>
<pre><code>$('#something-1' + item.id).attr("data-options", '{"pause":"YES","delete":"YES", "kill":"NO"}');
</code></pre>
<p>When I inspect with firebug I can see changed data options in html.</p>
<p>Then I have this "test" function which I trigger from firebug to see if the data has changed after the ajax update :</p>
<pre><code>(function() {
window.checkChanges = checkChanges;
function checkChanges(id) {
var dataOptions = $("#" + id).data('options');
for(var index in dataOptions) {
console.log(index,dataOptions[index]);
};
}
})();
</code></pre>
<p>But for some reason data options are the same before and after ajax request. I would need to somehow incorporate live function into this? or something else, but I don't have idea what? any suggestions?</p>
<p><strong>Edit</strong></p>
<p>Ajax requests changes delete to <code>YES</code></p>
|
javascript jquery
|
[3, 5]
|
3,473,207 | 3,473,208 |
JavaScript Function Return Scope
|
<p>A function triggers a database call which returns some Json. This CID is then used to stamp the newly added DOM element.</p>
<p>I need to retrieve / return the value of "cid" which exists within ajax success block, it will be used to update attribute.</p>
<p>Error
<strong>cid is not defined</strong></p>
<pre><code>//Save New Task
$("body").on('click','.icon-facetime-video',function(event){
var new_entry = $(this).prev().val();
var thebid = $(this).parents('tbody').prev().find('th').attr('id').split('_')[1];
$(this).parent().addClass('tk').html('<i class="icon-eye-open"></i> '+new_entry);
//CALL FUNCTION
var cid = update_entry('new_tk',new_entry,thebid); //value of cid from update_entry
$(this).parent().attr('id','cid_'+cid);
});
function update_entry(typeofupdate,new_entry,thebid){
switch(typeofupdate){
case 'new_tk': var action = 'new_tk';
break;
}
$.ajax({
type:'post',
url: 'posts_in.php',
dataType: "json",
data: {cid : thebid, action: action, content: new_entry},
success: function(data){
var action = data[0],cid= data[1];
console.dir(data);
}
});
return cid;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,492,370 | 5,492,371 |
GridView DataFormatString problems. convert Doudle to TimeStamp
|
<p>Need some help with DataFormatString in GridView. I have a Double value that needs to be shown as TimeSpan. I have tried DataFormatString="{0:HH:mm:ss}". This did not work. </p>
<p>Tested it a bit in C# and there I would do:</p>
<pre><code>TimeSpan.FromHours(16.7358217592592).ToString()
</code></pre>
<p>This gives me.</p>
<pre><code>"16:44:08.9580000"
</code></pre>
<p>Which is what i am after. But how to get it in ASP.Net is the big question.
Any Suggestions?</p>
<p>I have a simple GridView that looks like this.</p>
<pre><code><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="sOprTime" HeaderText="Sum OprTime" ReadOnly="True" SortExpression="sOprTime" />
<asp:BoundField DataField="sWorkTime" HeaderText="Sum WorkTime" ReadOnly="True" SortExpression="sWorkTime" />
<asp:BoundField DataField="sFaultTime" HeaderText="Sum FaultTime" ReadOnly="True" SortExpression="sFaultTime" />
</Columns>
<EmptyDataTemplate>
No data is present.
</EmptyDataTemplate>
</code></pre>
<p></p>
<p>The SQL query looks like this:</p>
<pre><code>sqlString1 = string.Format(@"SELECT SUM(CONVERT (Float, OprTime)) AS sOprTime, SUM(CONVERT (Float, WorkTime)) AS sWorkTime, SUM(CONVERT (Float, OprTime)) - SUM(CONVERT (Float, WorkTime)) AS sFaultTime FROM tblNovikLogg WHERE (Date_Time > '{0:yyyy/MM/dd H:mm:ss}' And Date_Time < '{1:yyyy/MM/dd H:mm:ss}')", selectedDate, selectedDate.AddDays(1));
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,069,843 | 3,069,844 |
How to embed a C# User Control into Windows Explorer?
|
<p>Is it a way to embed my User Control into Windows Explorer? Please tell me if you have any resources about this. </p>
<p>Thanks,
Weipeng</p>
|
c# c++
|
[0, 6]
|
6,024,584 | 6,024,585 |
serialize an object similar to $.param but do not call contained methods
|
<p>So I have an object that I would like to serialize, however the object contains non-idempotent methods. Is there a built in jQuery method to handle this, or do I need to build something custom?</p>
<p>This question will actually answer <a href="http://stackoverflow.com/questions/15779574/resource-update-method-behaving-strangely">$resource update method behaving strangely</a> which has become so bloated I felt it might be worth opening a new question since the solution may come in useful outside of the scope of the original question.</p>
<p><strong>UPDATE</strong>:</p>
<p>To clarify, I have the following object as output from console.log:</p>
<pre><code>Resource {$get: function, $save: function, $query: function, $remove: function, $delete: function…}
id: 1
name: "tits"
__proto__: Resource
$delete: function (a1, a2, a3) {
$get: function (a1, a2, a3) {
$query: function (a1, a2, a3) {
$remove: function (a1, a2, a3) {
$save: function (a1, a2, a3) {
$update: function (a1, a2, a3) {
</code></pre>
<p>So when I pass it through $.param(), all the methods on the object are triggered as part of the serialization process. Instead, I would only like to serialize the properties of the object which do not trigger any other methods.</p>
|
javascript jquery
|
[3, 5]
|
4,230,604 | 4,230,605 |
DropDownList in item template row comparison with in a GridView
|
<p>I have a <code>Dropdownlist</code> with in a <code>gridview</code>, in my grid I have 10 records, my dropdown values are 1,2,3...10. In first record drop down value is 1, second record dropdown value is 2....</p>
<ol>
<li><p>now I changed the 5 drop down value to 2, then second drop value is changed to 3 and 3 dropdown has been changed to 4, 4th dropdown has been changed to 5</p></li>
<li><p>I changed the 5th drop down value to 8, then 8th dropdown value is changed to 7, 7th dropdown has been changed to 6, 6th dropdown has been changed to 5</p></li>
</ol>
<p>this is my task plz help me to do t</p>
|
c# asp.net
|
[0, 9]
|
5,127,253 | 5,127,254 |
Visit Tracking - server-side / client-side
|
<p>I have an asp.net (webforms) application and I would like to track user visits to the site. I have the DB, objects, basic idea down.</p>
<p>My goal is to track a user from the first time he enters the site and up until he creates an account. So I can trace back where this user came from in his initial visit (Organic, paid, referrer, etc.).</p>
<p>I am planning to create a cookie with a GUID for each initial visit, store all actions in the DB, and finally, when the user registers, I can go back and update a username field for all rows matching the GUID.</p>
<p>My problem is that I can't make up my mind on the best method to do this.
Should I use an HTTP module and the session start and end events,
or maybe ajax calls to a WCF backend?</p>
<p>What would be the most efficient and accurate way to do this?</p>
|
c# asp.net
|
[0, 9]
|
3,004,500 | 3,004,501 |
Minimalizing namespaces for custom functions
|
<p>I have a StringUtilities.cs file in the CommonFunctions Project that holds a UppercaseFirst function that Uppercases the first word in a string. Currently in the .aspx.cs in a separate Project (in the same Solution) that is utilizing this function is called using <strong>MyProject.CommonFunctions.StringUtilities.UppercaseFirst("hello world");</strong></p>
<p>Is it possible to shorten it to just <strong>UppercaseFirst("hello world");</strong> ? Readability will be so much better.</p>
<p>StringUtilities.cs in the CommonFunctions Project:</p>
<pre><code>namespace MyProject.CommonFunctions
{
public class StringUtilities
{
public static string UppercaseFirst(string s)
{//blah code}
}
}
</code></pre>
<p>Default.aspx.cs</p>
<pre><code>using MyProject.CommonFunctions;
...
protected void Page_Load(object sender, EventArgs e)
{
MyProject.CommonFunctions.StringUtilities.UppercaseFirst("hello world");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
198,674 | 198,675 |
How to create a DataTable and filling it with a data from the database using the DataView?
|
<p>I am a new ASP.NET developer and I want to create a table programmatically using <code>HtmlTable</code> or <code>DataTable</code> and then filling this table with the data from the database using <code>DataView</code>. </p>
<p>I could be able to create a table using <code>HtmlTable</code> but when I did a search regarding "how to fill <code>HtmlTable</code> with a data using <code>DataView</code>", I found that DataView will not work with <code>HtmlTable</code>. So I repeated creating the table using the <code>DataTable</code>, but now I need to fill it with the data using <code>DataView</code>, so how can I do that?</p>
<p>My code: </p>
<pre><code> DataTable table = new DataTable();
DataColumn col1 = new DataColumn("Name");
DataColumn col2 = new DataColumn("Username");
col1.DataType = System.Type.GetType("System.String");
col2.DataType = System.Type.GetType("System.String");
table.Columns.Add(col1);
table.Columns.Add(col2);
DataRow row = table.NewRow();
row[col1] = "John";
row[col2] = "John123";
table.Rows.Add(row);
GridView gv = new GridView();
gv.DataSource = table;
gv.DataBind();
</code></pre>
<p>Regarding the table in the database, the schema of the User Table is:</p>
<pre><code>Username, FirstName, LastName, Age, Job
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,020,339 | 1,020,340 |
Download file by Jquery
|
<p>i search google and got a code snippet for downloading file by jquery. the syntax is like below</p>
<pre><code>var downloadURL = function(url)
{
var iframe;
iframe = document.getElementById("hiddenDownloader");
if (iframe === null)
{
iframe = document.createElement('iframe');
iframe.id = "hiddenDownloader";
iframe.style.visibility = 'hidden';
document.body.appendChild(iframe);
}
iframe.src = url;
}
</code></pre>
<p>but could not understand how it works. how call it and how to pass url. so please help me to use the above function and tell me how to pass url as argument. please also tell me what type of code is the above it is not a function.</p>
<pre><code>var downloadURL = function(url)
</code></pre>
<p>how it works. variable name equal to function name. a function can be called but the above code snippet can not be called. so please discuss in detail. thanks.</p>
|
javascript jquery
|
[3, 5]
|
689,889 | 689,890 |
Disable alert();
|
<p>Code that is generated on my page that I cannot control contains an alert. Is there a jQuery or other way to disable alert() from working?</p>
<p>The javascript that is being generated that I want to disable/modify is:</p>
<pre><code>function fndropdownurl(val)
1317 { var target_url
1318 target_url = document.getElementById(val).value;
1319 if (target_url == 0)
1320 {
1321 alert("Please Select from DropDown")
1322 }
1323 else
1324 {
1325 window.open(target_url);
1326 return;
1327 }
1328 }
</code></pre>
<p>I want to disable the alert on line 1321</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,322,920 | 4,322,921 |
Event when IFrame has posted back?
|
<p>I have some code that closes a modal in the parent when an IFrame's button is pressed.</p>
<p>This works well, but my problem is I need the IFrame to be fully postbacked before executing the close method.</p>
<pre><code>var $MyFrame = $("#editScheduleFrame");
// You need to wait for the iFrame content to load first
// So, that the click events work properly
$MyFrame.load(function () {
var frameBody = $MyFrame.contents().find('body');
var btn = frameBody.find('.schedule-submit');
btn.on('click', function () {
closeEditModal();
});
});
</code></pre>
<p>Is there any way I can instead call closeEditModal only once the schedule submit button has been pressed AND the IFrame child page has posted back?</p>
|
javascript jquery
|
[3, 5]
|
849,487 | 849,488 |
javascript process explain
|
<p>I found this js some page sources.actually what does this java script do?</p>
<pre><code><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20823326-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,193,712 | 5,193,713 |
clear a form without refresh
|
<p>am working with a form that has recaptcha and its validated with jquery, everything works perfectly fine *the info is sent to my email and all required field are checked before been send)</p>
<p>the only one problem am facing is that once the info is sent and all fields are reset the error messages are visible
only way they are hidden is if page is i change in the js "reset" instated of "clear" but this refresh the pagge and the thank u message isnt visible anymore.</p>
<p>(i know maybe all sounds bit confiusing)
this is the code what am talking </p>
<pre><code>function validateCaptcha(){
challengeField = $("input#recaptcha_challenge_field").val();
responseField = $("input#recaptcha_response_field").val();
nameField = $("input#name").val();
emailField = $("input#email").val();
phoneField =$("input#phone").val();
reasonField =$("input#reason").val();
messageField =$("textarea#message").val();
var html = $.ajax({
type: "POST",
url: "ajax.recaptcha.php",
data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField +"&name="+ nameField +"&email=" + emailField +"&phone="+ phoneField + "&reason=" + reasonField +"&message=" + messageField,
async: false
}).responseText;
if(html == "success")
{
$('#contactForm').each (function(){
this.reset();
Recaptcha.reload();
})
$("#thanks").html("Thank you");
return false;
}
else
{
$("#captchaStatus").html("Your captcha is incorrect. Please try again");
Recaptcha.reload();
return false;
}
}
</code></pre>
|
php jquery
|
[2, 5]
|
3,043,730 | 3,043,731 |
What are the fundamental differences between ASP.net and PHP?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/606419/net-asp-vs-php">.NET & ASP vs PHP</a> </p>
</blockquote>
<p>Are there speed differences, performance issues, and what reasons do businesses have when they choose one or the other, is the learning curve steeper for one over the other? </p>
<p>Also... are you likely to be paid more using one over the other?</p>
|
php asp.net
|
[2, 9]
|
5,748,770 | 5,748,771 |
How to count number of character which is entered in textbox?
|
<p>I have a label <code>lblCountCharacter</code> with text "4000" and a textbox <code>txtAddNote</code> where users can enter text. </p>
<p>On entering one character in <code>txtAddNote</code>, the label text is decreased by one.</p>
<p>Please help me write a function for this in asp.net using C#.</p>
|
c# asp.net
|
[0, 9]
|
3,691,273 | 3,691,274 |
jquery not seeing new html loaded into dialogue box
|
<p>I am having some trouble with getting jquery to recognize classes/ids of content that has been loaded into a dialogue box. All the jquery code (including the code that deals with the as yet unloaded classes) is loaded before the dialogue box is created, however the html that eventually goes into the dialogue box is created on the fly. I know it is going to get certain classes but don't know the rest of the code/content hence the reason I am loading it from the database. If I put the html on the page with the clickable class rather than the dialogue box it works, but I obviously don't want to do that. I was thinking this is a DOM problem since the class that jquery is going to be listening for is not on the page until AFTER the dialogue box is created (the dialogue box itself is also created by a click on another item - this has to happen this way as people may or may not want to get the dialogue box with the info from the database in it up). Any help in explaining and possibly finding a solution for this is much appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,183,253 | 5,183,254 |
null object reference in master pages
|
<p>I have some controls inside my master page, and i want to acces them from its related c# clas..</p>
<p>For instance i have:</p>
<pre><code><asp:DropDownList ID="ddlSearch" runat="server"
onselectedindexchanged="ddlSearch_SelectedIndexChanged"
AutoPostBack="True">
</asp:DropDownList>
</code></pre>
<p>and i can acces it when writing code, so "it sees its properties ok".</p>
<p>But at runtime i received </p>
<blockquote>
<p>Object reference not set to an instance of an object.</p>
</blockquote>
<p>Do u know why?</p>
<p>I also tried to find it like:</p>
<pre><code>ContentPlaceHolder mpContentPlaceHolder =
(ContentPlaceHolder)this.FindControl("ContentHead");
if (mpContentPlaceHolder != null)
{
DropDownList ddlSearch =
(DropDownList)mpContentPlaceHolder.FindControl("ddlSearch");
if (!Page.IsPostBack)
utils.fillDDLSearch(ddlSearch);
}
</code></pre>
<p>but it gives null too....which is really strange...</p>
<p>I tried with another object (an asp Image control, but exactly the same problem.
All it's ok at compiling time but gives null at runtime ALTHOUGH IT correctly finds out the content place holder.</p>
<p>Does anybody know the problem?</p>
<p><strong>The error:</strong></p>
<p><hr></p>
<p>Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.</p>
<p><hr></p>
|
c# asp.net
|
[0, 9]
|
1,972,521 | 1,972,522 |
preventDefault does not work on focus event
|
<p>I am trying to design a form such that if it has a certain class, the user should not be able to interact with any of the inputs. For various reasons, I would like to avoid using the "disabled" attribute. I am trying to prevent the default on the focus event and it is not working. I tested this in recent versions of Firefox, Chrome, and Android. I tried various combinations of events, such as "click change touchstart focus focusin". I tried puting "return false;" in the handler. Does anyone know why this is happening and how to make it work?</p>
<pre><code><!DOCTYPE html>
<html><head>
<title>input test</title>
</head>
<body>
<form class="disabled">
<input type="text">
</form>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(".disabled :input").bind("focus", function(e) {
e.preventDefault();
});
</script>
</body></html>
</code></pre>
<p>You can see an example at <a href="http://jsfiddle.net/54Xka/" rel="nofollow">http://jsfiddle.net/54Xka/</a></p>
<p><strong>EDIT:</strong> This will be on a site intended mostly for mobile browsers. I am planning to disable the inputs when a modal dialog is showing. The modal dialog is implemented using my own code. It is something very simple that shows and hides a div.</p>
<p><strong>EDIT 2:</strong> This is what I have now:</p>
<pre><code>$(".disabled :input").live({
focus: function() {
$(this).blur();
},
change: function(e) {
e.preventDefault();
}
});
</code></pre>
<p>It has some minor aesthetic issues but it works. When I have more time, I may try jfriend00's idea with the transparent gif, or something similar to what the jQuery UI dialog widget does, or maybe actually using the jQuery UI dialog widget to implement the dialog.</p>
|
javascript jquery
|
[3, 5]
|
4,885,001 | 4,885,002 |
how can i convert this code into android phone which have written in java?
|
<p>I want to convert this code to Android (for a phone) please guide me. </p>
<pre><code>import javax.swing.*;
public class Irr {
public static void main(String[] args) {
String s1=JOptionPane.showInputDialog(null,"Enter the value of i for +ve NPV without % =");
String snpv1=JOptionPane.showInputDialog(null,"Enter the +ve NPV=");
String s2=JOptionPane.showInputDialog(null,"Enter the i for -VE NPV with out % =");
String snpv2=JOptionPane.showInputDialog(null,"Enter the -ve npv with out - sign=");
float i1=Float.parseFloat(s1);
float npv1=Float.parseFloat(snpv1);
float i2=Float.parseFloat(s2);
float npv2=Float.parseFloat(snpv2);
float i3= i1/100;
float npv4= (npv1/(npv1+npv2));
float i5=((i2-i1)/100);
float irr=((i3+(npv4*i5))*100);
System.out.println("Your IRR (internal rate of return) ="+irr+"%");
}
}
</code></pre>
|
java android
|
[1, 4]
|
4,691,309 | 4,691,310 |
How to Overwrite first some bytes of a file with different bytes in android
|
<p>I have a problem that I want to overwrite first 2^21 bytes of a video file with another 2^21 bytes, but I don't know how to do that? Please suggest me the right solution for the same.</p>
<p>Thanks in advance.</p>
|
java android
|
[1, 4]
|
829,985 | 829,986 |
Datagrid refresh not working
|
<p>I have a datagrid to display some information from a SQL table, and then a simple textbox and button to allow users to add records to the database. Problem is, when the user clicks Add, the datagrid SHOULD update, but it doesn't, any ideas? The code in question is as follows:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
username.Text = Session["username"].ToString();
datetime.Text = DateTime.Now.ToString();
BindData();
}
protected void BindData()
{
string SQLQuery = "SELECT * From Filters";
OleDbConnection MyConn = new OleDbConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
DataSet resultsDataSet = new DataSet();
MyConn.Open();
OleDbDataAdapter DataAdapter = new OleDbDataAdapter(SQLQuery, MyConn);
DataAdapter.Fill(resultsDataSet);
DGFilters.DataSource = resultsDataSet;
DGFilters.DataBind();
if (resultsDataSet.Tables[0].Rows.Count == 0)
{
no_records.Visible = true;
DGFilters.Visible = false;
}
else
{
DGFilters.Visible = true;
no_records.Visible = false;
}
MyConn.Close();
}
protected void AddFilter_Click(object sender, EventArgs e)
{
OleDbConnection MyConn = new OleDbConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
MyConn.Open();
string SQLInsert = "INSERT INTO Filters (FilterString) VALUES ( '" + FilterToAdd.Text + "')";
OleDbCommand MyCmd = new OleDbCommand(SQLInsert, MyConn);
MyCmd.ExecuteNonQuery();
MyConn.Close();
DataBind();
}
</code></pre>
<p>Any ideas?</p>
|
c# asp.net
|
[0, 9]
|
4,864,192 | 4,864,193 |
Prevent user from chaning tokens within input box
|
<p>How to prevent the change of certain elements, tokens, within a textarea with javascript or jquery? For instance I have this string in an input</p>
<p>this is normal text {this can't be changed 1}. This is more text. {This can't be changed 2 }. And some more text</p>
<p>If a user tries to change text within the curly brackets I want to prevent that from happening.</p>
<p>I thought of finding the indexes of the start and stop indexes of the tokens and when a user tries to change an element, I would see if it falls within that range.</p>
<p>Is there a different approach that I can use?</p>
|
javascript jquery
|
[3, 5]
|
4,956,328 | 4,956,329 |
jQuery: Using Selectors on HTML from an Attribute
|
<p>I have some HTML that is stored as an attribute on a tag. I can access it in jQuery using </p>
<pre><code>$("input[id$='_myField_hiddenSpanData']").attr("value")
</code></pre>
<p>This looks like this:</p>
<p><code>"<span id='spantest\user' tabindex='-1' contentEditable='false' class='ms-entity-resolved' title='test\user'><div style='display:none;' id='divEntityData' key='test\user' displaytext='Test User' isresolved='True' description='test\user'><div data=''></div></div><span id='content' tabindex='-1' contenteditable onMouseDown='onMouseDownRw();' onContextMenu='onContextMenuSpnRw();' >Test User</span></span>"</code></p>
<p>I would need the value of the key attribute (test\user). Can I somehow tell jQuery to parse a block of HTML and apply selectors to it? I found I can wrap it into a new jQuery object by wrapping it into another $(): <code>$($("input[id$='_myField_hiddenSpanData']").attr("value"))</code> but I still did not manage to apply a selector on it.</p>
<p>Any hints? And no, sadly I do not control the markup that generates the hidden field.</p>
|
javascript jquery
|
[3, 5]
|
4,866,585 | 4,866,586 |
Javascript link with onClick event
|
<p>I am using a third-party shopping cart from <a href="http://simplecartjs.com/" rel="nofollow">http://simplecartjs.com/</a> .
For a normal checkout I can use:</p>
<pre><code><a href="javascript:;" class="simpleCart_checkout" >Checkout</a>
</code></pre>
<p>And it works. But I need to add some server-side functionality and don't know how to go about this. The code inside the javascript file where the simpleCart_Checkout class is stored is as follows:</p>
<pre><code>me.addEventToArray( getElementsByClassName('simpleCart_checkout') , simpleCart.checkout , "click");
</code></pre>
<p>EDIT: and this:</p>
<pre><code>me.checkout = function() {
if( me.quantity === 0 ){
error("Cart is empty");
return;
}
switch( me.checkoutTo ){
case PayPal:
me.paypalCheckout();
break;
case GoogleCheckout:
me.googleCheckout();
break;
case Email:
me.emailCheckout();
break;
default:
me.customCheckout();
break;
}
};
</code></pre>
<p>So I tried doing it using a button calling the method directly:</p>
<pre><code><asp:Button ID="CheckoutButton" runat="server" Text="Checkout"
onclick="CheckoutButton_Click" OnClientClick="Checkout()" />
<script type="text/javascript">
function Checkout() {
javascript: simpleCart.checkout;
}
</script>
</code></pre>
<p>Which calls the server-side but doesn't call the javascript link. I am new to asp.net and javascript so don't really know any other ways of how I can do this, please help.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,640,182 | 1,640,183 |
Asp.Net Button postback keeps firing
|
<p>For some reason the postback event keeps firing for my button. If I place a break point on the function(e) part with Firebug, the code just skips right over the function.
Return false does not work either.</p>
<pre><code><script>
$(document).ready
(
$('#<%:FilterButton.ClientID %>').click
(
function (e)
{
e.preventDefault();
$('#Filter').toggle();
}
)
);
</script>
</code></pre>
<p><strong>Edit:</strong>
Kundan and others have pointed out that I skipped passing in an anonymous function for the document.ready() event. Careless on my part.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
518,244 | 518,245 |
need help speeding up tag cloud filter for IE
|
<p>Any ideas on how to speed this up in IE (the filtering process performs decent in Firefox, but almost unusable in IE). Basically, it's a tag cloud with a filter text box to filter the cloud.</p>
<pre><code><html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#tagFilter').keyup(function(e) {
if (e.keyCode==8)
{
$('#cloudDiv > span').show();
}
$('#cloudDiv > span').not('span:contains(' + $(this).val() + ')').hide();
});
});
</script>
</head>
<body>
<input type="text" id="tagFilter" />
<div id="cloudDiv" style="height: 200px; width: 400px; overflow: auto;">
<script type="text/javascript">
for (i=0;i<=1300;i++)
{
document.write('<span><a href="#">Test ' + i + '</a>&nbsp;</span>');
}
</script>
</div>
</body>
</html>
</code></pre>
<p>thanks,
rodchar</p>
|
javascript jquery
|
[3, 5]
|
3,437,463 | 3,437,464 |
How to access object name for their value using jquery
|
<p>I have on object and I want to print their name and property name. How can I do that. I can access their properties value. Like I want print object name like 'first' and 'second' and their properties like 'value' and 'text' dont want to print value</p>
<pre><code><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function (){
var myDate= {
'first':{value:'30',text:'i am the one'},
'second':{value:'50',text:'i am the second'}
}
$('a').click(function (){
var t= $(this).text();
if(t=="both"){
$('.text').text(myDate['first'] + '' + myDate['second'] );
} else {
$('.text').text(myDate[t]);
}
});
});
</script>
</head>
<body>
<div class="text"></div>
<a href="#">first</a>&nbsp;&nbsp;<a href="#">second</a>
<a href="#">both</a>
</body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,795,479 | 4,795,480 |
How to call div content in widows.open()
|
<p>Actually i have a asp:LinkButton in aspx page and i just want that whenever user clicks on asp:LinkButton open popup on dat asp:LinkButton its already done and i have given another link to it(its ur website's link only) and its working fine,
but the problem is now i want to open a popup with checkboxes with the cities name.</p>
<p>i have made one type of you can say block in a DIV on the same aspx page in the bottom and now i want is to call this div content in the script above in windows.open..</p>
<p>Please help me out ..
asap</p>
<p>Thank You!</p>
|
javascript asp.net
|
[3, 9]
|
4,001,581 | 4,001,582 |
Referencing variables on another page using Javascript.
|
<p>I'm currently working on a sort of Administration method to be able to save certain text and to display this on another page. </p>
<p>Currently, the defaults in the "Admin" page are to be referenced from the other page. It's a simple page: </p>
<pre><code><asp:TextBox Text="Testing jQuery method" ID="TextBox" runat="server"/>
<asp:CheckBox Checked = "true" ID="CheckBox" runat="server" />
</code></pre>
<p>Now, the page that references these fields is actually a simple HTML file, so I'm trying to use jQuery to reference the fields. I'm trying to use a jQuery ajax call, but I can't seem to get it to work correctly. </p>
<pre><code><script type="text/javascript" src="Scripts/jquery-1.4.1.js">
var asp_checked;
var asp_text;
try {
jQuery.ajax({
url: '~/About.aspx',
success: function (response, status, xhr) {
if (status != "error") {
asp_checked = $('#CheckBox', response).text();
asp_text = $('#TextBox', response).text();
}
else { asp_text = "Error in jQuery Call"; }
},
async: false
});
document.write(asp_text);
}
catch (err) {
document.write("The jQuery is not working");
}
</script>
</code></pre>
<p>Things to note:<br>
1. I don't really know much about jQuery in general.<br>
2. I can't use cookies (I don't think). This is going onto our corporate intranet for announcements and such.<br>
3. The jQuery code was taken from SO, but I can't recall the Question reference. When I do I will update here. </p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,266,178 | 1,266,179 |
Detect a click on DIVs with unpredictable IDs in jQuery
|
<p>I have several div tags and I'm trying to detect which one clicked. Each result has a unique title, but the same id. How do I use .click() to know which one was clicked so I can get it's ID and use it?</p>
|
javascript jquery
|
[3, 5]
|
72,043 | 72,044 |
Increment value to attr using jquery
|
<p>I want to increment the value of i . The "for" loop does not work. </p>
<pre><code>$("a[href$='.xls']").appendTo(".xl1").attr('id','xl'+i);
</code></pre>
<p>I search all excel files and places them in a container and increment the value of their id.</p>
<p>Thanks
Jean</p>
|
php jquery
|
[2, 5]
|
2,313,294 | 2,313,295 |
Filter options of one SELECT control according to another SELECT control options with asp.net
|
<p>I have two select controls . the first one contains names of countries and the another one contains cities names . I need to make the second one display names of the cities of selected country from the first one.</p>
|
c# asp.net
|
[0, 9]
|
1,780,580 | 1,780,581 |
How to detect running ASP.NET version
|
<p>How can I see the version of .net framework which renders my aspx page on remote server?</p>
|
c# asp.net
|
[0, 9]
|
1,915,035 | 1,915,036 |
The operation has timed out after upload a file using upload control in c#
|
<p>I have a problem in file upload control in asp.net when I upload a file 4.72MB and after this I use smpt for send a mail then I got time out expire error</p>
<p>Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
4,383,135 | 4,383,136 |
CRIR & jQuery - hooking up a method to fire after CRIR loads?
|
<p>I have a JSP that uses jQuery and <a href="http://www.chriserwin.com/scripts/crir/" rel="nofollow">CRIR</a> to display a form with radio buttons. I'm using CRIR to style the radio buttons to give them a custom look.</p>
<p>CRIR appears to <a href="http://www.chriserwin.com/scripts/crir/crir/crir.js" rel="nofollow">set itself up</a> on load with something like this:</p>
<pre><code>crir.addEvent(window, 'load', crir.init, false);
</code></pre>
<p>I want to perform some initialization on page load <em>but after</em> <code>crir.init</code> (because <code>crir.init</code> sets all the radio buttons up). When I use </p>
<pre><code>$(document).ready( function() {
updateUIOnLoad();
});
</code></pre>
<p>it appears to get called <em>before</em> <code>crir.init</code>.</p>
<p>I'm not familiar with Javascript events, so I was wondering if there was a way to set things up so that a function would execute on document load but after <code>crir.init</code>.</p>
|
javascript jquery
|
[3, 5]
|
4,982,115 | 4,982,116 |
IMAGE_CAPTURE Intent never returns to onActivityResult(int, int, Intent);
|
<p>I start an <code>IMAGE_CAPTURE</code> Intent like this, and my activity's <code>onActivityResult()</code> get called:</p>
<pre><code>Intent i = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null);
i.putExtra("return-data", true);
startActivityForResult(i, PICK_ICON_FROM_CAMERA_ID);
</code></pre>
<p>But, if I start my Intent like this, the Capture Image Intent did get called, but my activity's <code>onActivityResult()</code> never get called:</p>
<pre><code>Intent i = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null);
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.parse("file:/" + "MyTestFile"));
i.putExtra("outputFormat", Bitmap.CompressFormat.PNG.name());
startActivityForResult(i, PICK_ICON_FROM_CAMERA_ID);
</code></pre>
<p>Can you please tell me how to get the 2nd case to work?</p>
<p>Thank you.</p>
|
java android
|
[1, 4]
|
1,124,281 | 1,124,282 |
How easy/difficult it is to create app to send text field to sql for Android?
|
<p>I have basic knowledge of Java but have never developed for Android.
A friend asked me for an app that seems easy enough to develop but I would need some help for Android.
All the app needs to do is send a text field (for example license plate number) to a predetermined SQL Server database.
Is this easy in Android as it sounds?</p>
<p>Thanks in advance. Cheers.
Darko.</p>
|
java android
|
[1, 4]
|
4,964,610 | 4,964,611 |
jQuery's problem with the position method
|
<p>If I have the following markup:</p>
<pre><code><div id="parent" style="width: 300px; height: 300px;">
<div id="child" style="position: relative; left: 0; top: 0; width: 100px; height: 100px;"></div>
</div>
</code></pre>
<p>and I want to get the position of the child relative to its parent, would the only way be as follows?:</p>
<pre><code>x = parseInt($('#child').css('left')); // returns 0 as needed
y = parseInt($('#child').css('top')); // return 0 as needed
</code></pre>
<p>Because if I do the following:</p>
<pre><code>x = $('#child').position().left; // most likely will not return 0
y = $('#child').position().top; // most likely will not return 0
</code></pre>
<p>the position is wrong due to the fact that the offset method does also add the margin, padding, and border of the grandparents (be it the body element with its default margins or any other grandparent element).</p>
<p>I need to get the right position (in my example it would be <code>0, 0</code>) but I suspect there is no method in jQuery that can calculate it for me?</p>
|
javascript jquery
|
[3, 5]
|
5,659,453 | 5,659,454 |
How do I call a defined variable with jQuery?
|
<p>I'm kinda stuck.</p>
<p>I defined three variables:<pre><code>var part1 = "<form><input type='button' value='Open Window' onclick='window.open('http://jsfiddle.net/
";
var part2="5Xket,"
var part3 = "'toolbar=no',menubar='no')></form>";</code></pre></p>
<p>My aim is to concat those variables to create a working link when clicking on the button.</p>
<p>This is my try to concat the values of the variables.</p>
<pre><code>var mytest_2=part1+part2+part3;
alert (mytest_2);</code></pre>
<p>By clicking a button the button from mytest2 should appear. Clicking on that button there should be opened a new window with the url <a href="http://jsfiddle.net/5Xket/" rel="nofollow">http://jsfiddle.net/5Xket/</a></p>
<pre><code>$('#searchbutton').click(function() {
$("<td class='testclass'><input id='an_id' type='text'></td>").show();
$(mytest_2).insertAfter('#an_id');</code></pre>
<p>Well, the button appears as it should, but won't open a window.
My guess is that I'm wrong with the syntax somewhere because the alert puts out the correct order of variables.</p>
<p>Any ideas? Thank you.</p>
|
javascript jquery
|
[3, 5]
|
3,617,382 | 3,617,383 |
Get parameters from TD of checked TR
|
<pre><code><table id="tab">
<tr><td><input type="checkbox"></td><td aaa="111">sdf</td><td bbb="222">sdfsd</td><td ccc="333">trs</td></tr>
<tr><td><input type="checkbox"></td><td aaa="342">hjk</td><td bbb="274">sdfsd</td><td ccc="337">sdg</td></tr>
<tr><td><input type="checkbox"></td><td aaa="432">hgj</td><td bbb="652">sdfsd</td><td ccc="747">dih</td></tr>
</table>
<span id="show">show</span>
$("#show").click(function(){
var text = [];
$("#tab").each(
if($(this).find(input[type=checkbox].is(:checked))){
text.push({
'aaa': $(this).attr('aaa'),
'bbb': $(this).attr('bbb'),
'ccc': $(this).attr('ccc')
});
}
)
console.log(text);
})
</code></pre>
<p>LIVE: <a href="http://jsfiddle.net/KFbbZ/" rel="nofollow">http://jsfiddle.net/KFbbZ/</a></p>
<p>If i click <strong>show</strong> i would like get all parameters form checked TR. How can i make it? My example is bad...</p>
|
javascript jquery
|
[3, 5]
|
5,825,049 | 5,825,050 |
How do i ensure my asp.net validators fire before i call client side javascript
|
<p>I have an asp.net application with basic CRUD functionality. On a page where i am capturing customer details i have several asp.net validators to required fields. I have attached a JS confirm box on the asp.net save button for the form. The trouble is that when the user leaves required fields unfilled and clicks the save button, the JS confirm box comes up, when the ok button is clicked, the save method is called successfully and only after this happened do the asp.net validators fire and display that required information has been left out.</p>
<p>How can i cause the validators to fire before the JS box pops up?</p>
|
javascript asp.net
|
[3, 9]
|
4,169,529 | 4,169,530 |
Coding in javascript: a mix of standard javascript and jquery? any issues?
|
<p>are there any problems mixing my code with standard javascript and jquery? Will things conflict? Would I be unable to use standard javascript within jquery calls?</p>
|
javascript jquery
|
[3, 5]
|
185,741 | 185,742 |
JQuery: get a child as you append it
|
<p>I am appending p tags to a div as I process a json request and would liek to style it according to what is in the request.</p>
<pre><code>$(document).ready(function() {
function populatePage() {
var numberOfEntries = 0;
var total = 0;
var retrieveVal = "http://www.reddit.com/" + $("#addressBox").val() + ".json";
$("#redditbox").children().remove();
$.getJSON(retrieveVal, function (json) {
$.each(json.data.children, function () {
title = this.data.title;
url = this.data.url;
ups = this.data.ups;
downs = this.data.downs;
total += (ups - downs);
numberOfEntries += 1;
$("#redditbox").append("<p>" + ups + ":" + downs + " <a href=\"" + url + "\">" + title + "</a><p>");
$("#redditbox :last-child").css('font-size', ups%20); //This is the line in question
});
$("#titlebox h1").append(total/numberOfEntries);
});
}
populatePage()
$(".button").click(function() {
populatePage();
});
});
</code></pre>
<p>Unfortunately things are not quite working out as planned. The styling at the line in question is applying to every child of the div, not just the one that happens to be appended at the time, so they all end up the same size, not sized dependent on their numbers.</p>
<p>how can I apply a style to the p tags as they are appended ot the div?</p>
<p>Edit: Thanks Fortes and Veggerby both worked, but i went with Fortes in the end because I did.</p>
|
javascript jquery
|
[3, 5]
|
3,502,973 | 3,502,974 |
In an asp.net project, how can I submit javascript objects?
|
<p>I have an array of javascript objects and I want to press a submit button and 'send' them much like I can access a textbox or listbox's members - ie. the page posts back and I can put some code in the button's submit method. Is there a way of doing this? Or do I have to put them into a control?</p>
|
javascript asp.net
|
[3, 9]
|
297,625 | 297,626 |
jQuery - go back button or wait and you get auto redirected - advanced go back button
|
<p>I used this button for a while:</p>
<pre><code><input type="button" class="button" onclick="javascript:history.go(-1)" value="Go back to previus page" />
</code></pre>
<p>And I would like to add feature to it, but I have no clue, since im javascript newb, so please give me some tips or even solution.</p>
<p>I would like that you would get redirected from that page on which this button is located, automaticaly in 10 seconds (timmer should show on the actual button).
OR if you click you get redirected instant?</p>
<p>Any ideas how to do this with jquery?</p>
|
javascript jquery
|
[3, 5]
|
117,837 | 117,838 |
__EVENTTARGET not populating after button click + C#/ASP.NET
|
<p>I have an asp button that produces this html: </p>
<pre><code><input type="submit" name="ctl00$m$g_a2ba5666_c8e9_4bd7_a44a_f9407dbe2199$ctl00$btnAddWebPart" value="Add Report" id="ctl00_m_g_a2ba5666_c8e9_4bd7_a44a_f9407dbe2199_ctl00_btnAddWebPart" />
</code></pre>
<p>When the button is submitted and the page_load method is hit, I am trying to do this: </p>
<pre><code>String target = Page.Request.Params.Get("__EVENTTARGET");
</code></pre>
<p>but, for some reason 'target' is empty. I checked to see if __EVENTTARGET is getting populated and it is an empty string. Any ideas as to why this is happening? It is something really silly.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
1,819,448 | 1,819,449 |
Change the style of one dynamically created LinkButton while not affecting others?
|
<p>I have a method that loops through a list and creates Links using the LinkButton control. For the purpose of this question, assume that it is a list of colors and that I have 5 colors: red, green, blue, red, and yellow. Here is a code snippet of how I am creating the links and adding the event handler.</p>
<pre><code>foreach(color in colors)
{
LinkButton lb = new LinkButton();
lb.Text = color.name;
lb.Click += new System.EventHandler(this.colorClick);
lb.CommandName = "CommandName";
lb.CommandArgument = "CommandArgument";
lb.ID = color.Id;
}
</code></pre>
<p>In the even handler, colorClick, I am bolding the clicked link by doing the following:</p>
<pre><code>protected void colorClick(object o, EventArgs e)
{
LinkButton lnk = (LinkButton)o;
lnk.Style["font-weight"] = "bold";
//Process clicked link.
}
</code></pre>
<p>The above code works fine as far as bolding the currently clicked link, the problem I run into is that assume that the link clicked was Red, so Red would be bold, if I click Blue, I want to bold the link Blue, but unbold Red. I have tried:</p>
<pre><code>lnk.Style["font-weight"] = "normal";
lnk.Font.Bold = "false";
</code></pre>
<p>but, it occured to me that while the above maybe correct, I am doing it in the wrong spot (colorClick). What I was thinking is that I probably have to remember the previously clicked link and unbold that one, but I am unsure of how to do that.</p>
|
c# asp.net
|
[0, 9]
|
3,735,773 | 3,735,774 |
How can I restart my application after rebooting of device?
|
<p>I have made Android application which uses one background service. It works good, but if user reboot his device that my application will be stopped. How can I fix it, i.e. how can I restart my application after rebooting of device?</p>
|
java android
|
[1, 4]
|
3,956,357 | 3,956,358 |
How to retrieve a value from <input> using jQuery?
|
<p>I have to hidden input fields such as:</p>
<pre><code><input name="foo" value="bar">
<input name="foo1" value="bar1">
</code></pre>
<p>I'd like to retrieve both of those values and POST them to the server using jQuery. How does one use the jQuery selector engine to grab those values?</p>
|
javascript jquery
|
[3, 5]
|
4,082,672 | 4,082,673 |
Radio Buttons in ASP.NET
|
<p>I'm bit new to .NET.
I am using Radio buttons inside a panel in a web page. (Since group boxes are not there).
But when I click on each radio button they all are checked. They are not acting as a group but single units.</p>
<p>Do I need to remove the panel here? Please help me.</p>
|
c# asp.net
|
[0, 9]
|
4,302,174 | 4,302,175 |
Saving a File on Android
|
<p>I'm sure this has been asked hundreds of times, but I just can't point myself to the right direction.</p>
<p>I'm working on an app that after the first startup, generates an instance of a class that takes and saves user input. After that first startup, on every consecutive startup, I want to read that same instance, or at least load the same data from before into a new instance. How do I go about doing that?</p>
<p>From what I understand, I'll need to save this on a file generated on internal storage, but I'm not really sure. The data should expand as time passes, so I'm not sure how much big the data will become.</p>
<p>Thank you for any help. </p>
<p>EDIT: I think I'll expand a bit more on what I need...</p>
<p>Basically, I'm working on a small robot that takes user input and saves it in it's "brain". What I need to do is save this "brain" into a file, so that on each launch of the app, this "brain" is loaded. The user input will be nothing but strings. </p>
|
java android
|
[1, 4]
|
2,766,927 | 2,766,928 |
jQuery logical operators for flow control instead of using if statement
|
<p>For some reason I can't get the succinct flow control syntax to work with jQuery. The following throws an error:</p>
<pre><code>$(this).hasClass('expanded') && return
</code></pre>
<p>Whereas this longer version works fine:</p>
<pre><code>if ($(this).hasClass('expanded')) { return}
</code></pre>
<p>Any ideas why the first one is throwing an error?</p>
|
javascript jquery
|
[3, 5]
|
2,821,387 | 2,821,388 |
Use Javascript/Jquery to to strip down a dynamic URL
|
<p>I have this function:</p>
<pre><code>popstate = function(url){
$('#ajaxloadcontent').load(url+"#ajaxloadcontent > *");
}
</code></pre>
<p>I need it to get the current page URL, lets just call that: "http://www.pearlsquirrel.com/index.php"</p>
<p>I then need to somehow use jquery and strip down the URL to just what is after "http://www.pearlsquirrel.com/" and be left with "index.php." Is there any kind of jquery or javascript function that would be able to help me do this?</p>
<p>Also, if it were to just get "http://www.pearlsquirrel.com," I would need the function also set the URL to a default index.php.</p>
|
javascript jquery
|
[3, 5]
|
5,023,700 | 5,023,701 |
Jquery How to use history plugin?
|
<p>In my web application I am using ajax and now I'd like the back and forward browser buttons to work. So I went looking for a jquery history plugin and found this one: <a href="http://stilbuero.de/jquery/history/" rel="nofollow">http://stilbuero.de/jquery/history</a></p>
<p>In my code I use a function to load a page:</p>
<pre><code>function loadDocument(id, doc) {
$("#DocumentContent").show();
// Clear dynamic menu items
$("#DynamicMenuContent").html("");
$("#PageContent").html("");
// Load document in frame
$("#iframeDocument").attr("src", 'ViewDoc.aspx?id=' + id + '&doc=' + doc + '');
// Load menu items
$("#DynamicMenuContent").load("ShowButtons.aspx");
}
</code></pre>
<p>As you can see I want my pages to load within an Iframe. Can someone tell me how I can use a history plugin so that the brwoser buttons will work? I don't really care which plugin it is, as long as the browser buttons work. I prefer an easy to use plugin.</p>
|
javascript jquery
|
[3, 5]
|
5,725,946 | 5,725,947 |
How do I make an applcation's launch icon run the preferences activity?
|
<p>I would like an app's launch icon run the app's preferences activity (as it has no Activities, only a Service).</p>
<p>The preferences are defined in res/xml/preferences.xml.</p>
<p>Please help me regarding this.</p>
|
java android
|
[1, 4]
|
2,710,928 | 2,710,929 |
Javascript in browser bar vs in content script - 'die' doesn't work
|
<p>I'm trying to run a javascript command in a content script using Personalized-Web (a Chrome extension). I'm new to javascript & jquery, but I've found that entering this code:</p>
<pre><code>javascript:jQuery("div.photo-container").die();
</code></pre>
<p>into my browser bar on a particular page achieves the desired result: it undoes a <code>.live</code> call performed in one of the page's javascripts.</p>
<p>However, if I include that same code or <code>$("div.photo-container").die();</code> in a content script, it does not work. I've also attempted including this script tag in the page context:</p>
<pre><code><script type="text/javascript">
$("div.photo-container").die();
</script>
</code></pre>
<p>and chrome claims that <code>$</code> or <code>jQuery</code> are not defined. However, the page's own javascripts don't <code>include</code> or refer to the jQuery source at any point, as far as I can tell.</p>
<p>So, what's the difference between the browser bar, the content script, and the in-page <code><script></code> tag? How can I use one of the 'automatic' methods (i.e., not paste it into the browser bar)?</p>
|
javascript jquery
|
[3, 5]
|
866,373 | 866,374 |
Converting double to string
|
<p>I am not sure it is me or what but I am having a problem converting a double to string.</p>
<p>here is my code:</p>
<pre><code>double total = 44;
String total2 = Double.toString(total);
</code></pre>
<p>Am i doing something wrong or am i missing a step here.</p>
<p>I get error <code>NumberFormatException</code> when trying to convert this.</p>
<pre><code>totalCost.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
try{
double priceG = Double.parseDouble(priceGal.getText().toString());
double valG = Double.parseDouble(volGal.toString());
double total = priceG * valG;
String tot = new Double(total).toString();
totalCost.setText(tot);
}catch(Exception e){
Log.e("text", e.toString());
}
return false;
}
});
</code></pre>
<p>I am trying to do this in an onTouchListener. Ill post more code, basically when the user touches the edittext box i want the information to calculate a fill the edittext box.</p>
|
java android
|
[1, 4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.