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 |
---|---|---|---|---|---|
1,701,713 | 1,701,714 |
Grabbing content off webpage that is in script tags
|
<p>OK, I have this page I want to get the content off.. however the stats are made in JavaScript. Is there ANY way I can get the stats? I tried using PHP get_content thingy...</p>
<p>Here is an example that is in the page I want to get. This <code><script></code> is between the <code><body></code> tag.</p>
<pre><code>< script >
na=0;
S=new Array;
S[na]="|Beal|3266561|137|131|1170664|714062|1378742|2375|128|322|"; na++;
S[na]="|Marine|2446933|165554|125613|1116688|652869|187250|23773|27019|148167|"; na++;
S[na]="|Krackle1|2306919|342794|440503|372482|238609|442226|146516|177399|146390|"; na++;
S[na]="|LawyerUpSir|1666817|60579|236847|379476|219395|446057|149787|151306|23370|"; na++;
S[na]="|IKillToWin|1657426|94695|214229|800157|446579|59618|9132|8861|24155|"; na++;
S[na]="|Farts|1644623|6885|8790|972072|586678|49249|10558|2838|7553|"; na++;
< / script >
</code></pre>
|
php javascript
|
[2, 3]
|
1,232,005 | 1,232,006 |
Android SearchView select all text on Honeycomb
|
<p>I'd like to select all text on the SearchView content.</p>
<p>Is any way can set selection on the all text?</p>
|
java android
|
[1, 4]
|
1,381,663 | 1,381,664 |
ASP.NET C# Graphics Path shape
|
<p>I'm having problem generating certian path for slightly modified round corner rectagle, here is code I am using for generating round rectagle:</p>
<pre><code> public static System.Drawing.Drawing2D.GraphicsPath RoundedRectangle(Rectangle r, int d)
{
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddArc(r.X, r.Y, d, d, 180, 90);
gp.AddArc(r.X + r.Width - d, r.Y, d, d, 270, 90);
gp.AddArc(r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90);
gp.AddArc(r.X, r.Y + r.Height - d, d, d, 90, 90);
gp.AddLine(r.X, r.Y + r.Height - d, r.X, r.Y + d / 2);
return gp;
}
</code></pre>
<p>And now I need to generate something like this:</p>
<p><img src="http://i.stack.imgur.com/Vyzuj.png" alt="enter image description here"></p>
<p>What would be best approach to achive this? Maybe erasing left border and then adding right triangle somehow?</p>
<p>Any help is appreaciated, thanks!</p>
|
c# asp.net
|
[0, 9]
|
1,983,018 | 1,983,019 |
How can I display a backslash in a browser using javascript?
|
<p>as mentioned below, I have some code in my jsp inside a script tag .</p>
<p>I am getting this: <code>444444444666666666666666666\888888888888</code> </p>
<p>but I want this: <code>444444444\666666666666666666\\888888888888</code><br>
(The backslash should be escaped)</p>
<p>So how can i avoid this and display the text as it is? I have tried different ways to replace the backslash("\") but I have been unsuccessful.</p>
<pre><code> <script>
var mytxt ="444444444\666666666666666666\\888888888888";
document.write(mytxt);
</script>
Actual O/P in browser : 444444444666666666666666666\888888888888
Expected O/P in browser : 444444444\666666666666666666\\888888888888
</code></pre>
|
java javascript
|
[1, 3]
|
4,014,473 | 4,014,474 |
Post large data in C#
|
<p>I have the following scenario</p>
<ol>
<li>Have a web browser control which uses the Navigate method to call a web page. I have the need to post a large number of elements via FORM POST. The number of elements can be either 40-100 elements.</li>
</ol>
<p>Is it advisable to encode this and send it via the the Navigate method?</p>
<p>Does one normally do this via FORM POST or is there a better solution? I may be able to get the client to expose a webservice and maybe i could stream an xml file to them</p>
|
c# asp.net
|
[0, 9]
|
1,497,098 | 1,497,099 |
ASP.NET/Jquery: document ready in update panel?
|
<p>I have the following user-control:</p>
<pre><code><%@ Control Language="C#" AutoEventWireup="true" CodeFile="FadingMessage.ascx.cs" Inherits="includes_FadingMessage" %>
<asp:PlaceHolder Visible="false" runat="server" ID="plhMain">
<span id="<%= this.ClientID+"_panel" %>" style="background-color:yellow; padding:10px;">
<b><%= Message %></b>
</span>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
alert("never gets here??");
jQuery('#<%= this.ClientID+"_panel" %>').fadeOut(1000);
});
</script>
</asp:PlaceHolder>
</code></pre>
<p>Which is used in an asp:UpdatePanel. My problem is that $(document).ready is never fired?</p>
<p>How can I detect when a partial rendering has finished?</p>
|
c# asp.net jquery
|
[0, 9, 5]
|
1,139,624 | 1,139,625 |
How do I add & remove values from a hidden input field?
|
<pre><code><input type="hidden" id="values" value="1,2,1,3" />
<a href="#" id="add" data-value="4">add</a>
<a href="#" id="remove" data-value="1">remove</a>
<script type="text/javascript">
$(document).ready(function()
{
$('#add').click(function()
{
var value = $(this).attr('data-value');
//add to $('#values')
return false;
});
$('#remove').click(function()
{
var value = $(this).attr('data-value');
//remove all values that match in $('#values');
return false;
});
});
</script>
</code></pre>
<p><strong>Examples</strong></p>
<p>a) Add, output would be: 1,2,1,3,4</p>
<p>b) Remove, output would be 2,3</p>
|
javascript jquery
|
[3, 5]
|
5,015,012 | 5,015,013 |
change this to jquery
|
<p>How would I change the below to jquery? It works in IE but not Firefox so I am hoping if I change it to jquery it will work for both.</p>
<p>THIS</p>
<pre><code>function subform() {
if (parent.option_view.document.vform_.dispatchEvent('onsubmit') != false) {
parent.option_view.document.vform_.submit();
}
}
</code></pre>
<p>AND THIS</p>
<pre><code>img class="save_bttn" src="/images/save.gif" height="16" width="16" border="0" onclick="subform()"
</code></pre>
<p>IS INSIDE ONE CHILD FRAME</p>
<p>and</p>
<p>It is trying to init in another child frame that is why its going to parent option_view.</p>
<p>*note: I was not trying to scream with the caps I was just trying to show where talking was and where the javascript is</p>
|
javascript jquery
|
[3, 5]
|
2,220,697 | 2,220,698 |
Selecting images inside a form using jQuery
|
<p>I've got some server side PHP code that dynamically displays thumbnails of all the images contained in a directory:</p>
<pre><code><form>
<input type="hidden" name="animal">
<div id="thumbs">
\\ Dynamically created thumbnails start
<img src="images/bat.jpg">
<img src="images/cat.jpg">
<img src="images/rat.jpg">
\\ Dynamically created thumbnails end
</div>
</form>
</code></pre>
<p>I want the correct jQuery syntax so that when a user clicks on one of the images it:</p>
<ul>
<li>Removes border styles from all of the thumbnails</li>
<li>Highlights the selected thumbnail by adding a coloured border</li>
<li>Changes the value of the form field "animal" to the file name shown in the image.</li>
</ul>
<p>Any help much appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,534,473 | 5,534,474 |
Encode a String in JavaScript
|
<p>I need HTML ENCODE in JavaScript (client side) a String (where User could insert HTML TAGS) from a TextBox so bypassing Reqeust.Validation.</p>
<p>Javascript should Encode string and Display it Encoded in Label.</p>
<pre><code> <asp:TextBox ID="uxValueInput" runat="server"></asp:TextBox>
<br />
<asp:Label ID="uxResultEncoded" runat="server" Text="Label"></asp:Label>
<asp:Button ID="uxEncodeButton" runat="server" Text="Button" />
</code></pre>
<p>I am new in JavaScript and I have tried different scripts on a web but with no success.
Could you please post a really simple example so I would be able to understand how could work. Thanks!</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
880,045 | 880,046 |
ASP.NET: How to assign ID to a field in DetailsView?
|
<p>I have a master-detail page, in which I use GridView to display multiple rows of data, and DetailsView + jQuery dialog to display the details of a single records. only one DetailsView is open at a time.</p>
<p>I need to be able to pull out a single field of the open DetailsView, for manipulation using JavaScript. Is there a way to give a unique ID to a given field in DetailsView, so I can use getElementByID? Or is there another way to accomplish what I'm trying to do?</p>
<p>Thank you in advance.</p>
|
asp.net javascript jquery
|
[9, 3, 5]
|
2,282,092 | 2,282,093 |
Include HTML file via JavaScript
|
<p>This is a file stored locally, not on a server, so Server Side Includes do not work.</p>
<h2>Problem:</h2>
<p>I have an HTML file. There is lots of data in it, I want to split it into smaller parts, and then just include them all into my big html file, i.e. something like:</p>
<pre><code>main.html
<include "partA.html">
<include "partB.html">
<include "partC.html">
</code></pre>
<p>And I want the result as if the contents of partA,B,C.html were read right into main.html</p>
<p>Now, this is not on a server -- it's stored locally, so I can't do SSI. My question is:</p>
<p>Is there some simple way to do this via JavaScript? It seems like with JavaScript, I shoudl be able to:</p>
<ul>
<li>fetch the contents of blah.html [not sure how to do this ste[</li>
<li>call a document.write on it, to write it into the document</li>
<li>probably handle some stuff dealing with escaping strings</li>
</ul>
<h2>Question:</h2>
<p>How do I do this?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
5,562,018 | 5,562,019 |
Adapting Library for Android
|
<p>The library given consists of several parts:</p>
<ul>
<li>a network module</li>
<li>a storage module</li>
<li>a 'controller' module</li>
</ul>
<p>They all rely on the former module (storage relies on network, controller relies on storage). Most of the functionality is exposed in controller module.</p>
<p>My first plan was to wrap the whole library in a Service that serves as a Adapter for the Android world. But I found out that Services do not have a way to get a result back. So there is no (reasonable) way to call some of the 'getStuff'-Methods in the Controller Module.</p>
<p>What is the 'Android Way' of doing this?</p>
<h2>Edit</h2>
<p>The network module has to run continuously in the background cause it handles some ongoing network stuff. (so this should be a service, right?) The storage module listens for events from the network and updates itself. As these are <em>POJOs</em> the storage module is registered at the network module.</p>
<p>In the Android Part of the Application i have several Activities. All of these need to access the storage module. But there is no way to get a reference to it cause it is in the Service part of the application.</p>
<p>I would wrap all required methods in Intent responses, but afaik Service Intents can not be called with a result.</p>
<p>So ... how do i get my data from the service into activities?</p>
|
java android
|
[1, 4]
|
4,755,350 | 4,755,351 |
Serving a json file for IPHONE app
|
<p>I am trying to get an introduction to serving files to the iphone. I have watched tutorials on getting files from sites like Flickr and twitter. I need a tutorial to show me how to set up the site that is feeding that information. Most of those sites send you a json file. Can I just keep a dynamic file on a server using php?</p>
|
php iphone
|
[2, 8]
|
3,312,247 | 3,312,248 |
Including Javascript within web pages
|
<p>Can anyone please recommend the best and easiest way to include multiple Javascript files on a (PHP based) web page?</p>
<p>I have a website that uses jQuery, and anything up to around 10 plugins on any one particular page. I'm not entirely sure of the best way to go about including all these files to make life simple for me as a dev, and to ensure that they are best served to a user.</p>
<p>Ideally I thought the easiest way myself would be to build a PHP handler file that I could use to call which plugins I reqire for each page, and then have it output javascript that used document.write() to 'include' each plugin JS file on the page, like so:</p>
<pre><code><script src="handler.php?jquery,plugin1,plugin2,plugin3,plugin4"></script>
</code></pre>
<p>which might then output Javascript with multiple document.write()'s to each individual plugin.</p>
<p>I am led to believe this might lead to problems with browser caching however, as some browsers ignore caching of items with query strings.</p>
<p>Is this OK to do, or is there a simpler method that I'm perhaps missing?</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,398,327 | 3,398,328 |
Display Particular Div on my another website
|
<p>I two website abc.com content div with id 'abc' and another website def.com. content div with id 'def'. The Qns is how can I display content of div having id='abc' into div id='def'. </p>
|
php javascript
|
[2, 3]
|
4,169,985 | 4,169,986 |
jquery error is not a funtion code
|
<p>Is it possible for someone to provide the full code that "declares your preload() method before you call it" for this "<a href="http://stackoverflow.com/questions/9434830/jquery-error-is-not-a-function">jquery error "is not a function"</a>" question</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,155,053 | 4,155,054 |
How to iterate through table with id='test' and get ids of each row inside table?
|
<p>How to iterate through table with id='test' and get ids of each row inside table using JQuery ?
I need to collect ids in array.</p>
|
javascript jquery
|
[3, 5]
|
3,928,861 | 3,928,862 |
Having content or image fadeIN with jquery when using inner html
|
<p>How would you go about fading content or an image when using javascripts innerHTML.</p>
<p>I tried many things but my lack of knowledge in javascript/jquery is making it difficult.</p>
<pre><code>function swapLogo(){
document.getElementById("title").innerHTML='';
document.getElementById("logo").innerHTML='<img src="images/logo_filled.gif"/>'.fadeIn('slow');
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,173,180 | 4,173,181 |
Accessing the same object in different events
|
<p>I want to have an array of objects that is shared between two different methods.</p>
<p>The onclick for button1 on my webpage calls method1, which populates the needed values for the objectArray. I need the onclick method for button2 to be able to access the same objectArray with the same data that method1 was working with.</p>
<pre><code>using myWebReference;
{
public partial class _Default : System.Web.UI.Page
{
ObjectArray[] myObjects = new ObjectArray[100];
public void Page_Load(object sender, EventArgs e)
{
//I have nothing in here at the moment
}
public void method1(object sender, EventArgs e)
{
//myObjects[]'s values are calculated and assigned here.
}
public void method2(object sender, EventArgs e)
{
String key = myObjects[0].value;
//when I try to get data within myObjects here, myObjects does exist,
//but it is empty and I get a null reference error when I try to use its values.
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,352,070 | 2,352,071 |
ASP.net C# SQL count(*)
|
<p>I have a query that I'm running in C# .cs file:</p>
<pre><code>DataSet ds = db.ExecuteDataSet(System.Data.CommandType.Text, "SELECT count(*) as counter FROM [Table] where [Table].[Field] = 'test'");
</code></pre>
<p>I want to do is retrieve the value of "counter" in this query and "return" it as my functions return value.</p>
<p>How can I do that?</p>
|
c# asp.net
|
[0, 9]
|
1,168,785 | 1,168,786 |
How to print the position of each value in a table column using jQuery
|
<p>Quick jQuery question. Columns in my table represent a racers split time in a race. I want to compare the split time of one racer to the split time of another. For example, I have 3 racers with split times of 3 seconds, 4 seconds and 2 seconds respectively. </p>
<p>In the table cell next to each time, I'd like to output the position compared to other racers like so: 3 seconds (2), 4 seconds (3), and 2 seconds (1). </p>
<p>I'm sure it is a simple matter of adding each split time to an array, then iterating over each and printing the position. However I can't seem to wrap my head around how to accomplish this problem. </p>
<p>Here's a jsfiddle table as an example: <a href="http://jsfiddle.net/hYvdp/" rel="nofollow">http://jsfiddle.net/hYvdp/</a></p>
|
javascript jquery
|
[3, 5]
|
3,870,700 | 3,870,701 |
Share business logic in asp.net (c#) and android (java)
|
<p>I'm working on a project that has a website (asp.net c#) and android app (java) that share some common functionality. Currently when they need to use the same business logic the android makes a call to the website and gets the results. We've had a request for the android to work "offline", so it would need to perform that business logic without hitting the website. Are there any ways to do that?</p>
<p>The only thing we've thought of so far are using javascript, as a node.js server for asp.net to hit and rhinoscript to include in the java. This will work, but I was hoping for a less complex (not having to run node.js and .net servers).</p>
<p>An example of the logic needed is passing in a couple of products and calculating discounts, taxes, etc to return the total price. It's a bit more complex than that, but not too much.</p>
|
java android asp.net
|
[1, 4, 9]
|
2,041,143 | 2,041,144 |
Photo number detection for Android/Java?
|
<p>Is there any available software or framework for Java/Android that can analyze an image and extract numbers? For example, take a photo of an advertisement and have the software extract the number. This is not what I want to do (that's what QR is for), but just serves as an example. If there is not, does anyone know of any online papers/resources/studies on this subject? </p>
|
java android
|
[1, 4]
|
1,101,345 | 1,101,346 |
jQuery: input text remaining chars counter
|
<p>I'm trying to write a simple remaining chars counter for my backoffice <code>input</code> texts with <code>jQuery</code> but it doesn't work:</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
function text_counter (input_text, target) {
var max = $(input_text).attr("maxlength");
$(input_text).keydown (function () {
var timer = setTimeout (function () {
var text = $(input_text).text();
var current = text.length;
$(target).text(current + "/" + max);
}, 1);
});
}
text_counter ("#description", "#description_counter");
});
</script>
<input id="description" type="text" maxlength="250" value="Default text">
<span id="description_counter"></span>
</code></pre>
<p>If I start to write inside the <code>input</code>, the <code>span</code> element change in <code>12/250</code> and freeze here (12 == "Default text".length).</p>
<p>Where I'm wrong?</p>
|
javascript jquery
|
[3, 5]
|
1,313,973 | 1,313,974 |
How to get controls depending upon the iteration count?
|
<p>I want to get clientId dynamically depending upon the iteration count e.g</p>
<pre><code>var clientID = "<%=NumericTextBox" + 1 + ".ClientID %>";
var id = document.getElementById(clientID);
</code></pre>
<p>but if i try to use above statements to get the control it throws ";expected", ")exppected" errors what is the proper way of getting the control?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,151,607 | 1,151,608 |
Check if the requested user has admin privileges
|
<p>In a web application, is there any way to check the requested user has got admin privileges.
Is it possible? Can you suggest one method?</p>
<p>For example: a front-end user requests a page in my application. I want to know whether the user that made the request has admin privileges in his client machine. I have to check whether he is logged in with an admin privileged account in the system.</p>
<p>I need the privileges of logged in user to the system not to my application , my application doesn't have a login. One user just request my home page or any other page and i just want to know that user is logged into his PC with an admin account or not?</p>
|
c# asp.net
|
[0, 9]
|
2,334,051 | 2,334,052 |
Fire event on checkbox .change() but *after* a checkbox appears checked?
|
<p>I'm using jQuery to capture a click event on a checkbox and call a function. </p>
<p>My issue is this: the function I'm calling is relatively slow to execute, and so the user sees a visible delay before the checkbox appears to be checked, which makes the interface appear sluggish and inelegant. </p>
<p>This fiddle demonstrates the problem: <a href="http://jsfiddle.net/ZkUgq/4/" rel="nofollow">http://jsfiddle.net/ZkUgq/4/</a> or code here: </p>
<pre><code>function slowFunction() {
var mystr;
for (var i = 0; i < 5000000; i++) {
mystr += ' ';
}
}
$('#mycheckbox').click(function() {
slowFunction();
});
</code></pre>
<p>Is there a way I can change things so that the click event still fires <code>slowFunction</code>, but doesn't delay the appearance of a tick in the checkbox?</p>
<p>Ideally what I'd like is an <code>onChecked</code> event for the checkbox, but I don't know if that exists. </p>
<p>NB: the reason I'm asking is because I'm using an <a href="http://awardwinningfjords.com/2009/06/16/iphone-style-checkboxes.html" rel="nofollow">iPhone Checkbox</a>, and the relatively slow function that I call when my checkboxes changes makes it look sluggish, and not iPhone-like at all :)</p>
|
javascript jquery
|
[3, 5]
|
2,945,395 | 2,945,396 |
Resize image to specific width and fix height
|
<p>I want to resize big images to have a width of 150 pixels and the height will be fixed.
and then save the image into a folder in my website.</p>
<p>examples: (width,height)
if I resize an image 300px*300px I will get a resized image of 150px*150px.
if I resize an image 450px*300px I will get a resized image of 150px*100px.</p>
<p>the point is that the ratio between width and height will be saved always keeping a width of 150 pixels.</p>
<p>Any Help?</p>
|
c# asp.net
|
[0, 9]
|
5,509,933 | 5,509,934 |
Jumping from one method to another using goto statement
|
<p>Can i use <strong>goto statement</strong> to jump from one method into another in c++ , java or c#. </p>
|
c# java
|
[0, 1]
|
1,156,735 | 1,156,736 |
dialog box with multiple checkboxes android souce code
|
<p>I have an android app with a button. When clicking the button I need on the screen a dialob box with multiple check boxes annd an ok button. How to do that? Do i need an xml layout for the list with checkboxes?</p>
<p><strong>1. How to add to each element in the list dialog box a check box?</strong></p>
<p><strong>2. How to put in a string all the checked elements when the button OK is pressed.</strong></p>
<p>this is my code so far:</p>
<pre><code> app_part.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
final String items[] = {"1","2","3","4"};
AlertDialog.Builder ab=new AlertDialog.Builder(ConferenceClass.this);
ab.setTitle("SIP CONTACTS");
ab.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int choice) {
// on OK button action
}
});
ab.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int choice) {
// on Cancel button action
}
});
ab.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int choice) {
}
});
ab.show();
//open contact list and select persons
}
});
</code></pre>
|
java android
|
[1, 4]
|
1,359,348 | 1,359,349 |
jQuery execute function when option is selected from option object
|
<p>I am dynamically creating the options for a select element using jQuery. Is it possible in jQuery to setup a function to be executed when that option is selected?</p>
<p>I know I can detect the change of the entire select element, but is it possible to specify this on a per-option basis? Maybe something like this:</p>
<pre><code>$('<option />').onselect(function(){
// do something
});
</code></pre>
<p>Edit:
If it's not possible to specify a function that get's executed when a specific option is selected, is it possible to bind a function to an element in jQuery? It would make my logic cleaner by allowing me to just simply execute that function assigned to the option in the .change for the select.</p>
|
javascript jquery
|
[3, 5]
|
3,307,979 | 3,307,980 |
Compiler error:The type or namespace name 'Core' does not exist in the namespace 'System' (are you missing an assembly reference?)
|
<p>I try to upload an image in my project which is in c#.and my code in the submit button is following</p>
<pre><code>FileUpload1.SaveAs(
Server.MapPath("Photos\\" +
System.Core.WebSecurity.GetUserName(Request) + ".jpg"));
Response.Write(
"<html> <script> alert ( 'you have successfully uploaded' ); </script></html>");
Response.Redirect("studentcreated.aspx");
</code></pre>
<p>but on compiling it shows an error as </p>
<blockquote>
<p>The type or namespace name 'Core' does not exist in the namespace
'System' (are you missing an assembly reference?)
.</p>
</blockquote>
<p>Then i try to solve this by adding system.core to reference.But still it shows the same error.I am using vs2008 asp3.5.Please help urgently </p>
|
c# asp.net
|
[0, 9]
|
2,647,356 | 2,647,357 |
Extract text value from aspx via php
|
<p>Trying to get a text value either "yes" or "no" from an aspx page via my php product page.</p>
<p>from here..</p>
<p>after code= i need to insert the product model number $products_model</p>
<p>example..
<a href="http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code=RN311014" rel="nofollow">http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code=RN311014</a></p>
<p>replace RN311014 with $products_model and then echo back the text result</p>
<p>hope someone can help..</p>
<p>thanks scott</p>
<p>i tryed this within my orginal code</p>
<pre><code><?php $contents = file_get_contents("http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code={$products_model}", NULL, NULL, 0, 3); echo $contents;
</code></pre>
<blockquote>
<p>Blockquote</p>
</blockquote>
|
php asp.net
|
[2, 9]
|
3,041,304 | 3,041,305 |
Trouble with ImageView gravity on Java, Android
|
<p>I have this code: </p>
<pre><code><LinearLayout
android:layout_weight="0.5"
android:layout_width="0px"
android:id="@+id/linearLayout2"
android:orientation="vertical"
android:layout_height="fill_parent">
<LinearLayout
android:layout_weight="0.45"
android:layout_width="fill_parent"
android:id="@+id/linearLayoutMainLogo"
android:orientation="horizontal"
android:gravity="center"
android:layout_height="0px">
<ImageView
android:src="@drawable/logo"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:id="@+id/imageViewLogo"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</code></pre>
<p>I need to set ImageView in center of LinearLayout by horizontal and by vertical simultaneously, but my code doesn't work. Where did I do mistake? Thank you</p>
|
java android
|
[1, 4]
|
402,144 | 402,145 |
View.getId and R.id.viewLabel return different values
|
<p>Let's say I have a method like this into my activity, and set it as <code>onClick</code> field of different buttons into xml:</p>
<pre><code>public void onButtonPressedFromView(View button) {
switch(button.getId()) {
case (R.id.button1) :
//do something
break;
case (R.id.button2) :
//do something different
break;
default :
//default action
break;
}
}
</code></pre>
<p>It comes out that, if I press for instance button1, the id obtained with <code>button.getId()</code> is always bigger of 1 than the id obtained with <code>R.id.button1</code>. It's quite easy to solve, I just changed my code into</p>
<p><code>switch(button.getId() - 1)</code></p>
<p>but I don't like it, and would like to understand the difference between these two ways of obtaining the id of a view.</p>
|
java android
|
[1, 4]
|
2,640,568 | 2,640,569 |
How to select the first child of every div
|
<p>I am trying to select the first div of several divs.</p>
<p>I have</p>
<pre><code><div class='parent'>
<div class='child'>good</div>
<div class='child'>bad</div>
<div class='child'>nice</div>
<div class='child'>fun</div>
</div>
<div class='parent'>
<div class='child'>test</div>
<div class='child'>dead</div>
<div class='child'>fly</div>
<div class='child'>pipe</div>
</div>
<div class='parent'>
<div class='child'>weee</div>
<div class='child'>jump</div>
<div class='child'>run</div>
<div class='child'>apple</div>
</div>
</code></pre>
<p>I want to select the first child div of all parent divs</p>
<p>so </p>
<pre><code> <div class='child'>good</div>
<div class='child'>test</div>
<div class='child'>weee</div>
</code></pre>
<p>will be selected</p>
<p>I have tried:</p>
<pre><code>1 $('.parent .child').first().css('border-top','0'); //only select the first one
2 $('.parent).each(function(){
$(this).css('border-top','0');//can't find the first child..
})
</code></pre>
<p>Are there anyways to do this? Sorry my brain is fried now. Thanks!</p>
|
javascript jquery
|
[3, 5]
|
1,207,015 | 1,207,016 |
Want to show a message box using javascript
|
<p>Hi everyone I have a web form in which I am having a button on clicking which data back up is being taken, I used the following javascript :</p>
<pre><code><script language="javascript" type="text/javascript">
function showPleaseWait() {
document.getElementById('PleaseWait').style.display = 'block';
}
</script>
<asp:Button ID="btnTakebackup" runat="server" Text="Take Backup" Enabled="true"
onMouseDown="showPleaseWait()" CausesValidation="false" />
<div id="PleaseWait" style="display: none;">"Please Wait Backup in Progress.."</div>
</code></pre>
<p>Hi I am using a button to take a back up.</p>
<p>Now I want to show a message in <code>btnTakebackup_Click()</code> event, whether Back up was successful or not.
I used <code>Response.Write("<script>alert('abcd');</script>");</code> in <code>btnTakebackup_Click()</code> event.
But the problem is that I want to show the page also, which is not showing instead white background is showing.</p>
<p>Thanks in advance...</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,580,560 | 5,580,561 |
How can I use Eval in asp.net to read fields from a database?
|
<p>Here is the situation:</p>
<p>I have a webform that needs to read specific fields from a database that uses the eval function in the .aspx page. I know how to assign the values in the .aspx page, but in the code behind how do I "get" the values and bind them to the .aspx page? Can I just used a datareader? Dataset? What exactly am I going to be binding or reading to the dataset or reader? Do I need to create a method? </p>
<p>I already have the stored procedure created to pull the data from the database. I was going to create a method with the stored procedure. I just dont which kind to create...dataset, datareader? And how do I code it in the code behind? </p>
|
c# asp.net
|
[0, 9]
|
3,222,661 | 3,222,662 |
ASP.NET webpage taking too long to load
|
<p>I am new with ASP.NET and i built the webpage <a href="http://www.fmc-law.com/resourcecentre.aspx" rel="nofollow">1</a>but its taking too long to load. </p>
<p>Any ideas what might be causing the problem and how should i resolve this problem..</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
4,265,458 | 4,265,459 |
Is having too many setTimeout()s good?
|
<p>I'm using mostly Javascript on my scripting. I have some scripts which do several tasks every 1 second, and some every 0.02 seconds, etc. My intervals do tasks like checking of ifs, doing some innerHTML, little animation, etc. Now I have 4, but I think it would increase in the future; maybe I'll control myself to less than 10. Though it doesn't lag at all in my computer.</p>
<ol>
<li>Generally, will it be good for a site? </li>
<li>Since it's client-side obviously there won't be any issues with internet connection, right?</li>
<li>Is it a bad practice, or is it not much of an issue at all?</li>
</ol>
<p>Also, I have a question for jQuery. There are things that normal Javascript and jQuery can do similarly (like innerHTML and .html()), right? Given this situation, which should I prefer to use, jQuery or Javascript?</p>
<p>Thank you.</p>
|
javascript jquery
|
[3, 5]
|
3,443,576 | 3,443,577 |
Stop SMS Receiver
|
<p>I am using SMS Receiver Service which starts from Android Manifest File, using the following code. The problem is that it will remain working even after the application exits. <strong>How do I stop this service from receiving SMS?</strong></p>
<p>Start Service CODE:</p>
<pre><code><receiver android:name=".dataAccess.SMSReceiver" android:enabled="true">
<intent-filter >
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
</code></pre>
|
java android
|
[1, 4]
|
3,642,513 | 3,642,514 |
Request.ServerVariables in function
|
<pre><code>public static string Call()
{
string ref1 = HttpContext.Current.Request.ServerVariables["HTTP_REFERER"];
Response.write(ref1);
}
public void Page_Load(object sender, EventArgs e)
{
Call()
}
</code></pre>
<blockquote>
<p>CS0120: An object reference is required for the non-static field,
method, or property 'System.Web.UI.Page.Response.get'</p>
</blockquote>
|
c# asp.net
|
[0, 9]
|
68,769 | 68,770 |
Works in Firefox but not IE
|
<p>I make use of the following to find a string in a particular element, if it exists, tick a checkbox. This works great on Firefox but not internet explorer (8). I am having trouble finding why.</p>
<pre><code>$.fn.searchString = function(str) {
return this.filter('*:contains("' + str + '")');
};
var myID = $('div').searchString(files_array[i].substr(-4));
alert(myID);//[object object]
alert(myID.children());//[object object]
myID.children().attr('checked', true);//does not tick checkbox
alert(myID.children().attr('checked'));//undefined
</code></pre>
<p>Does IE not like the children() function?</p>
<p>Thanks all for any help</p>
|
javascript jquery
|
[3, 5]
|
1,489,502 | 1,489,503 |
Working on Infinite Load in jQuery and can't get the Load function to load only once
|
<p>I'm working on an <code>Infinite Load</code> (e.g. Lazy Load) type functionality here is the function so far:</p>
<pre><code>$(window).scroll(function() {
var ScrollPosition = $(window).scrollTop() + $(window).height();
var LoadMorePosition = $(document).height()-100;
if( ScrollPosition == LoadMorePosition ) {
console.log('loading more');
loadMoreItems();
}
});
</code></pre>
<p>It's working for the most part except for that the <code>loadMoreItems</code> function is called 20-30 times once the person scrolls to the threshhold.</p>
<p>I was thinking a setTimeout type thing might work but on second thought I realized that it would only work if the Ajax content loaded fast enough (which isn't guaranteed).</p>
<p>What I need is a way to detect if they hit the threshold and then call the function only once until they hit the scroll threshold again.</p>
|
javascript jquery
|
[3, 5]
|
4,303,454 | 4,303,455 |
Actual Element That Lost Focus
|
<p>I am working on an application that has a GridView item on an ASP.net page which is dynamically generated and does a partial post-back as items are updated within the grid-view. This partial post-back is causing the tab indices to be lost or at the very least ignored as the tab order appears to restart. The grid view itself already has the pre-render that is being caught to calculate the new values from the modified items in the grid-view. Is there a way to get what element had the focus of the page prior to the pre-render call? The sender object is the grid-view itself.</p>
|
c# asp.net
|
[0, 9]
|
4,892,262 | 4,892,263 |
Best way to return dynamic non-html content from a page
|
<p>I should start by saying that I am using ASP.NET using C# in a .NET 2.0 environment. In particular, I am trying to generate a csv download when the user clicks on a link button. The link to my postback is inside an UpdatePanel. In the past (before ajax) to return non-html content I would use code such as the following:</p>
<pre><code>string filename = e.CommandArgument.ToString();//somefile.csv
string fileContents = SomeClass.GetFile(filename);
Response.AddHeader("Content-disposition",
string.Format("attachment; filename={0}", filename));
Response.Write(fileContents);
</code></pre>
<p>But since the content is not trying to do a full refresh of the browser this technique does not work.</p>
<p>Does someone have a better approach for this kind of situation. One constraint I have is that I am stuck with .net 2.0 for this part of the project and can't switch to 3.5 to solve this problem. </p>
<p>p.s. I need to generate the content with a dynamic filename as well</p>
|
c# asp.net
|
[0, 9]
|
2,771,077 | 2,771,078 |
Error when upload files on ftp server
|
<p>Please help me, I have a very big problem.</p>
<p>I want to upload a file on godaddy ftp server using asp.net c#. When I run the application in visual studio the file is created successfully on ftp server but, when I create this file using a url such as (www.domain/page.aspx) directly I get this error (using asp.net 4.0):</p>
<blockquote>
<p>Unable to connect to the remote server </p>
</blockquote>
<p>And I get this error when I use asp.net 3.5:</p>
<blockquote>
<p>Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</p>
</blockquote>
<p>Please help me.</p>
|
c# asp.net
|
[0, 9]
|
2,999,099 | 2,999,100 |
How to close the window after response?
|
<p>I am using ASP.NET and C#. I am generating pdf and sending that on the pageload using </p>
<pre><code>response.TransmitFile(file);
</code></pre>
<p>So after this I need to close this window.I try to write the dynamic script for closing, but that did not work.</p>
<p>On button click i am using this code to open the window.</p>
<pre><code>window.open("Export.aspx?JobNumbers=" + jobnums,'',"resizable=0,scrollbars=0,status=0,height=200,width=500");
</code></pre>
<p>On pageload of export.cs I am creating the pdf using itextsharp.Then snding that using this.It is called on the buttonclick of the button that is clicked dynamically using </p>
<pre><code> string script = "var btn = document.getElementById('" + Button1.ClientID + "');";
script += "btn.click();";
Page.ClientScript.RegisterStartupScript(this.GetType(), "Eport", script, true);
</code></pre>
<p>This is the onclick event of button.</p>
<pre><code> protected void StartExport(object sender, EventArgs e)
{
response.Clear();
response.ContentType = "application/pdf";
response.AddHeader("content-disposition", "attachment;filename=" + Path.GetFileName(strFilePath));
response.TransmitFile(strFilePath);
response.Flush();
}
</code></pre>
<p>After this i need to close this export.aspx window for that i used this. </p>
<pre><code>Page.ClientScript.RegisterStartupScript(this.GetType(), "Export", "window.onfocus=function(){window.close();}", true);
</code></pre>
<p>And</p>
<pre><code>HttpContext.Current.Response.Write("<script>window.onfocus=function(){window.close();}</script>");
</code></pre>
<p>But did not worked.</p>
<p>Is it possible?</p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
700,839 | 700,840 |
Javascript private variables
|
<p>How can I make my <code>tabs</code> variable private and only accessible from within the <code>return {}</code>... <code>console.log(tabs)</code> returns <code>undefined</code>...</p>
<pre><code>$(document).ready(function () {
Site.page = (function () {
return {
init: function () {
Site.page.tabs.init();
},
//manage deal tabs
tabs: (function () {
var tabs = null;
return {
init: function () {
console.log(tabs);
},
show: function (tab) {
$('#deal-tabs > div.selected').removeClass('selected');
$(tab).addClass('selected');
}
}
})()
}
}());
Site.page.init();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
136,741 | 136,742 |
get all cookies of my site
|
<p>how can i get all the cookies set by my site using js. I dont want to do say <strong>Cookie("username")</strong> but loop through all the cookies and get the key=value pairs of my site</p>
|
php javascript
|
[2, 3]
|
3,274,090 | 3,274,091 |
jQuery objects and parameters - using correct terminolgy/explanation
|
<p>I'm posting due to a lack of understanding of a couple of concepts and also to check if my description of this code is accurate.</p>
<p>First I have created parent object called contactForm. I've made this object equal to an object literal which uses literal notation that is, creating a new object with { } and defining properties within the brackets.</p>
<p>Then I have the init method. If you’re familiar with object orientated programming that would be the same things as your constructor method. </p>
<p>Now the next part is where is where I am confused. I am using jQuery to create a new element which are the button tags. Is this newly created element an object inside of the parent object called contactForm? </p>
<p>My second question is am I passing a parameter that sets the text to 'Contact Me!' to the contactForm object or the button element/object? </p>
<p>My final question - is it the case that the parameter passed to the object can also be called a property of that object?</p>
<p>Sorry if I haven't been descriptive enough or accurate enough with my terminology. Any succinct and clearly explained answers would be massively appreciated.</p>
<pre><code>var contactForm = {
init: function() {
$('<button></button>', {
text: 'Contact Me!'
})
.insertAfter('article:first');
}
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,876,881 | 1,876,882 |
jQuery or javascript age calculator
|
<p>I want jQuery or javascript age calculator, set the age of a user when their birthday is selected, I want do show from her age that a few days and months and years last. </p>
<p>For example: </p>
<blockquote>
<p>user birthday is : <strong>29/04/2010</strong> <br> The result should be like this:
<strong>2 years, 4 months, 5 days old.</strong></p>
</blockquote>
<p>What should be the best way to do this by jQuery or javascript?</p>
|
javascript jquery
|
[3, 5]
|
3,542,965 | 3,542,966 |
Flip image in jQuery
|
<p>I have a collection of small images (bellow “Some examples” in the left column ) I would like to flip one at the time.
I imagine that they flip and a new image is shown (like flipping a card).</p>
<p>Is there a jQuery plug in for this, or can I do it with ordinary jQuery?</p>
<p><a href="http://www.dvdboxswap.com" rel="nofollow">Link to site</a></p>
<p>//Johan</p>
|
asp.net jquery
|
[9, 5]
|
2,678,777 | 2,678,778 |
How can we know when pop-up window url is loaded (window.open)?
|
<p>I need to change the URL of the page in the pop-up as soon as it completes loading ( I am using window.open function call).
Is there anyway I can find out when the page in pop-up has completed loading in the parent window? I cannot change anything in the page I am opening in pop-up, because it belongs to another website.</p>
|
javascript jquery
|
[3, 5]
|
1,146,827 | 1,146,828 |
iphone apns localization in urdu
|
<p>i have implemented ray's tutorials on apns on client side and on server side using this php script
<a href="https://github.com/sebastianborggrewe/PHP-Apple-Push-Notification-Server" rel="nofollow">https://github.com/sebastianborggrewe/PHP-Apple-Push-Notification-Server</a></p>
<p>now i am displaying alerts in english inside app, but now i want to display them in urdu language, i have read that apple guide, for this</p>
<p><a href="https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW3" rel="nofollow">https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW3</a></p>
<p>"Passing the Provider the Current Language Preference (Remote Notifications)"
My question is that i only have to change my preferred language of the device, and rest of the work means the urdu text message will be generate on php side and when a message sent from there will display in urdu on my device? or should i have to change my code of receiving and displaying notification on client side app, and what should be that change, i am little confused here, so plz. guide, thanx and regards Saad. </p>
|
php iphone
|
[2, 8]
|
1,046,043 | 1,046,044 |
How to create stored procedure in sql server and call that procedure from C# code behind with some parameters to that procedure
|
<p>I am trying to create the following stored procedure in sql server Lat and Lng are the parameters being passed from c# code behind .But I am not able to create this stored procedure
it indicates with error saying undefined column name Lat,Lng</p>
<pre><code>CREATE FUNCTION spherical_distance(@a float, @b float, @c float)
RETURNS float
AS
BEGIN
RETURN ( 6371 * ACOS( COS( (@a/@b) ) * COS( (Lat/@b) ) * COS( ( Lng/@b ) - (@c/@b) ) + SIN( @a/@b ) * SIN( Lat/@b ) ) )
END
</code></pre>
<p>This is my query from c# code behind.</p>
<pre><code>sqlda.SelectCommand.CommandText = "select *, spherical_distance( Lat, 57.2958, Lng) as distance
from business
where (( distance < '" + radius + "' )
and (StreetName like '%" + streetname + "%')
and (Keyword like '%" + keyword1 + "%' ))
order by spherical_distance(Lat,57.2958,Lng)";
</code></pre>
<p>This is the view clause</p>
<pre><code>create view [dbo].[business] as
SELECT Id,
Name1,
ZipCode,
StreetName,
StreetNumber,
State1,
Lat,
Lng,
Keyword
FROM Business_Details
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,496,398 | 3,496,399 |
Hover function in js spills over
|
<p>I have set up my page so that when the user hovers over an image a text shows up and some bubbles. There are eleven images of fish and each one has its own text and bubble. I made sure that there is no overlap in the divs containing the fish, but when one hovers over a particular image the text of some of the other images show up too. This is too distracting since the user would want to see one text at a time. How can I solve this issue? Here is the link to the page: <a href="http://arabic001.com/colors" rel="nofollow">http://arabic001.com/colors</a></p>
|
javascript jquery
|
[3, 5]
|
4,479,336 | 4,479,337 |
how to encrypt third party api key in a website
|
<p>I got an api key from yelp. I am still learning how to use this api in my website.
As of now my api key is in java script which is visible to everyone. I am using visual studio for developing this website.</p>
<p>can anyone tell me how to encrypt this api key? </p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
1,203,883 | 1,203,884 |
read information off website and store in excel file
|
<p>I am trying to build this application that when provided a .txt file filled with isbn numbers will visit the isbn.nu page for that isbn number by simply appending the isbn to the url www.isbn.nu/<em>your isbn number</em>.</p>
<p>After pulling up the page, I want to scan it for information about the book, and store that in an excel file. </p>
<p>I was thinking about creating a file stream of the url in Java, but I am not really sure how to extract the information from the html page. Storing the information will be done using the JExcel Java package. </p>
<p>My best guess would be using javascript to extract the information, but I don't know how to call the javascript from my java program.</p>
<p>Is my idea plausible? if not, what do you guys suggest I do. </p>
<p>my goal: retrieve information from an html page and store it in an excel file for each ISBN in a text file. There can be any number of isbn's in a text file. </p>
<p>This isn't homework btw, I am simply doing this for an organization that donates books to Sudan. Currently they have 5 people cataloging these books manually and I am one of them. </p>
|
java javascript
|
[1, 3]
|
1,375,471 | 1,375,472 |
jQuery toggle nested inside trigger not working
|
<p>For some reason, the below simple script won't work - I want the sub-menu to toggle when I click on the Portfolio link (the sub-menu hides correctly). </p>
<p>If I change the trigger div so that it's elsewhere on the page, it works fine. Can someone explain what the problem with the below is? Are you not allowed to nest or something?</p>
<p>Thanks in advance.</p>
<p>JS:</p>
<pre><code><script>
jQuery(document).ready(function ($) {
$('.sub-menu').hide();
$('#menu-item-154 > a').click(function(){
$('.sub-menu').toggle();
});
});
</script>
</code></pre>
<p>Page HTML</p>
<pre><code><div class="menu-main-menu-container">
<ul id="menu-main-menu" class="">
<li id="menu-item-154" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-154">
<a href="#">Portfolio</a>
<ul class="sub-menu">
<li id="menu-item-26" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-26"><a href="/?page_id=20">ITEM 1</a></li>
<li id="menu-item-55" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-55"><a href="/?page_id=48">ITEM 2</a></li>
</ul>
</li>
<li id="menu-item-56" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-56"><a href="/?cat=1">NEWS &#038; BLOG</a></li>
</ul>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,887,891 | 3,887,892 |
change base function behaveiour
|
<p>Assume I have executed this js code:</p>
<pre><code>var container=function() {
//do something
}
container.a=function {
//do something 2
}
container.b='34'
</code></pre>
<p>Here, in order to change container.a function for example I need to do:</p>
<pre><code>container.a=function() {
//do something 3
}
</code></pre>
<p>How do I change the function container() ?</p>
|
javascript jquery
|
[3, 5]
|
4,612,371 | 4,612,372 |
Multiple longclicklisteners
|
<p>I have 10 items that when long clicked, will bring up an item specific dialog. This is not a listview.</p>
<p>Right now, I'm registering a long click listener on every item. Is it possible to capture the view of the long clicked item much like you can set android:onClick="buttonClick" and in code have public void buttonClick(View v), where you can then identify the clicked button using v?</p>
|
java android
|
[1, 4]
|
4,763,124 | 4,763,125 |
JQuery advice needed
|
<p>I have a page and I want to show some paragraphs after clicking a link, before that it should be hidden. So i wrote a simple JQuery code, but the problem is when I click the open link all the other hidden divs are also shown. My code is given below please advice how to solve the issue.</p>
<p>HTML</p>
<pre><code><div>
<a href="#" class="open_div">Read More</a>
<div class="expand_div">
<a href="#" class="close_div"><img src="images/close_button.gif" width="50" height="12" alt="Close" border="0" /></a>
<p>My hidden content goes here..</p>
</div>
</div>
</code></pre>
<p>and I want to repeat the above <code><div></code> block 7 times. So when I click the first div's Read more button the remaining 6 hidden divs are also showing!!! </p>
<p>JQuery</p>
<pre><code><script language="JavaScript">
$(document).ready(function(){
$('a.open_div').click(function(){
$('.expand_div').show();
});
$('a.close_div').click(function(){
$('.expand_div').hide();
});
});
</script>
</code></pre>
<p>how to solve this issue..?</p>
<p>any answers would be appreciated!</p>
<p>Thanks</p>
<p>Paul</p>
|
javascript jquery
|
[3, 5]
|
4,614,178 | 4,614,179 |
How to use win32::WriteFile when there is possible fail option?
|
<p>I using the win32 method 'WriteFile' to do some work in C# ( version .net 4.0 )
I need to wait till the method will finish the task and to do it i using 'WaitForSingleObject' .</p>
<p>But there is some cases that the method 'WriteFile' is fail ==> so for this case i gave the 'WaitForSingleObject' 30 seconds time-out. </p>
<p>But after this 30 seconds i get off the scope of the method 'WriteFile' => there if the GC will run the objects that i gave as arguments in the method 'WriteFile' will be collected and when this happened i get a crash !!! - </p>
<p>I checked the dump and its saying the i have memory corruption.
When i remove the line of 'WriteFile' the crash is not appears. </p>
<p>How to solve it ?!
I can't make the variables of the 'WriteFile' method to be global and i must leave them as local variables. </p>
<p>The code </p>
<pre><code> public void foo(byte[] bufferToWrite)
{
unsafe
{
NativeOverlapped overlapped = new NativeOverlapped()
{
EventHandle = eventHandle,
OffsetLow = ( int )( s & 0xffffffff ),
OffsetHigh = ( int )( s >> 32 & 0xffffffff )
};
GCHandle gch = GCHandle.Alloc( bufferToWrite, GCHandleType.Pinned );
IntPtr ptr = new IntPtr( ( void* )gch.AddrOfPinnedObject() );
bResult = WriteFile( handle, ptr, length, ref bytesWritten, &overlapped );
if( bResult == ERROR_SUCCESS == || bResult == ERROR_IO_PENDING )
{
dwResult = WaitForSingleObject( EventHandle, 30000 );
}
}
}
</code></pre>
|
c# c++
|
[0, 6]
|
5,554,988 | 5,554,989 |
what's the difference between these two javascript calls?
|
<p>what does the 'function' do in the following:</p>
<pre><code>$('.event-row').on('mouseover',function(){
arc.event_handler.event_row_over();
});
$('.event-row').on('mouseover',arc.event_handler.event_row_over );
</code></pre>
<p>thx in advance</p>
|
javascript jquery
|
[3, 5]
|
92,063 | 92,064 |
What is the better way of handling HTTP responce statuses?
|
<pre><code>HttpResponse response = mHttpClient.execute(mHttpGet);
if(response.getStatusLine().getStatusCode() == 201){
}
.....
</code></pre>
<p>I have different statuses and I need to handle all them to show later for appropriate status appropriate dialog message. </p>
<p>What is the better way of handling HTTP response statuses?</p>
|
java android
|
[1, 4]
|
33,192 | 33,193 |
Is there some issue doing it in jQuery?
|
<p>I can do it without worry about performance problems?</p>
<pre><code>$(document).ready(function() {
(function(new_selector) { new_selector('.classname').fadeIn('fast'); })($);
});
</code></pre>
<p>or</p>
<pre><code>$(function() {
(function(new_selector) { new_selector('.classname').fadeIn('fast'); })($);
});
</code></pre>
<p>thanks.</p>
<p>maybe it could be a idiot question but i like to worry about performance.</p>
|
javascript jquery
|
[3, 5]
|
4,203,948 | 4,203,949 |
How to: Swap options with jQuery while using jQuery UI
|
<p>I've been trying to find a way to swap option values between them while I am using jQuery UI. I made a simple fiddle which would swap options but it works only when I'm not using jQuery UI.</p>
<p>Working fiddle <strong>without</strong> jQuery UI loaded on Options: <a href="http://jsfiddle.net/mBMRp/" rel="nofollow">http://jsfiddle.net/mBMRp/</a></p>
<p>Working fiddle <strong>with</strong> jQuery UI loaded on Options: <a href="http://jsfiddle.net/FUUYq/" rel="nofollow">http://jsfiddle.net/FUUYq/</a></p>
<p>Thanks alot</p>
|
javascript jquery
|
[3, 5]
|
3,820,031 | 3,820,032 |
Pass index from one control to another
|
<p>I have two DropDownLists that are in a GridView. The DropDownLists only show when the GridView is in edit mode. The first DropDownList is filled correctly. Based on the selection in the first DropDownList, the selected value will be an input into the query for the second DropDownList. How do I go about doing this in C#? What sort of parameter do I define for the second DropDownList? The DebtorKey is what comes from the first DropDownList.</p>
<p>ASP code for the second DropDownList</p>
<pre><code><asp:ObjectDataSource ID="ObjectDataSourceSpokeTo" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="ValidationPortal.VerificationDataSetTableAdapters.getSpokeToTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" DefaultValue="0" Name="DebtorKey"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,204,776 | 2,204,777 |
Why does my Android Calculator crash?
|
<p>Why is my app crashing? I'm using eclipse. I don't see why it would crash. Everything seems fine to me. No missing semi-colins that I see.</p>
<pre><code>package rechee.cool;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class HelloAndroidActivity extends Activity {
/** Called when the activity is first created. */
public EditText display;
double total1=0;
double total2=0;
char theOperator;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
display= (EditText) findViewById(R.id.editText1);
}
String display1= display.getText().toString();
public void getOperator(String btnText){
theOperator = btnText.charAt(0);
double displayValue= Double.parseDouble(display1);
total1+=displayValue;
display.setText("");
}
public void onClick(View v) {
switch(v.getId()){
case R.id.bOne:
display.append("1");
break;
case R.id.bTwo:
display.append("2");
break;
case R.id.bThree:
display.append("3");
break;
case R.id.bFour:
display.append("4");
break;
case R.id.bFive:
display.append("5");
break;
case R.id.bSix:
display.append("6");
break;
case R.id.bSeven:
display.append("7");
break;
case R.id.bEight:
display.append("8");
break;
case R.id.bNine:
display.append("9");
break;
case R.id.bZero:
display.append("0");
break;
case R.id.bPoint:
display.append(".");
break;
case R.id.bClear:
display.setText("");
break;
case R.id.bAdd:
String btn_text= (String) getText(R.id.bAdd);
display.setText(btn_text);
//getOperator(display1);
break;
//case R.id.bEqual:
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
1,822,253 | 1,822,254 |
"The HTTP verb used to access this page is not allowed" on an .msi Download via a LinkButton
|
<p>Ive got a asp.net web application and have just added a a new link to allow users to download</p>
<pre><code><asp:LinkButton ID="lnkDownload" runat="server" Text="Download"
PostBackUrl="/download/releases/program.msi" onclick="lnkDownload_Click"
ToolTip="Download">
</asp:LinkButton>
</code></pre>
<p>But when I click the link I get
HTTP Error 405 - The HTTP verb used to access this page is not allowed.</p>
<p>I assume I need to change some setting in IIS (IIS 6) any one know what ?</p>
|
c# asp.net
|
[0, 9]
|
4,606,254 | 4,606,255 |
How to get a list of active applications in Android?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3304685/how-to-get-the-list-of-running-applications">How to get the list of running applications?</a> </p>
</blockquote>
<p>How to get a list of active applications in Android?
Thanks for answers.</p>
|
java android
|
[1, 4]
|
564,374 | 564,375 |
invalid argument jquery.js
|
<p>Webpage error details</p>
<p>Message: Invalid argument.
Line: 116
Char: 165
Code: 0
URI: /wp-includes/js/jquery/jquery.js?ver=1.4.2</p>
<p>I've searched everyhwere for answers. I've finally determined that this error is being caused by the php called in this page: <a href="http://pittsburghweddingphotographer.whsites.net/wedding-pricing/" rel="nofollow">http://pittsburghweddingphotographer.whsites.net/wedding-pricing/</a></p>
<p>This error comes up in IE8 and not Firefox.</p>
<p>The availability script (php code) was given to me by a friend. I simply replaced my info with his.</p>
<p>Would someone please assist me in working this out? Feel free to talk down to me, I'm not even a novice.</p>
|
javascript jquery
|
[3, 5]
|
5,678,412 | 5,678,413 |
Loop over elements in jQuery when element is double clicked
|
<p>I'm new to jQuery and Javascript. I'm trying to make a button that I can double click which then loops through all elements in the webpage with a certain class and fades them.</p>
<p>Currently, I'm trying this:</p>
<pre><code>$(".fadeall").dblclick(function() {
$("div.section").each(function(idx,item) {
item.fadeTo(25,inactiveOpacity);
});
});
</code></pre>
<p>In my debugger I see the double click happening, but the function in the <code>each</code> call is not being triggered.</p>
<p>I'm believe I'm not matching the <code>div.section</code> elements correctly, but don't know the correct approach.</p>
|
javascript jquery
|
[3, 5]
|
1,004,711 | 1,004,712 |
How to pass data from JavaScript into ASP.NET code behind?
|
<p>I trying to pass data from JavaScript variable into code behind asp.net in C#.</p>
<p>is there any better way for passing data to back-end beside using hidden field control?</p>
<p>where JavaScript assign value into hidden field control, then back-end code get the value from hidden field control.</p>
<p>Thank you for the help</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,312,908 | 3,312,909 |
a:active not working on mobile device
|
<p>my question is: Why this div(with class="menu_cent") not working the class .menu_cent:active, when I clicking on it on mobile devices, but on desktop its works.</p>
<pre><code> <div class="m_10">
<a href="#" onclick="set_lng('en')"><div class="menu_cent">English</div></a>
</div>
.menu_cent
{background:#fff;font-family:Arial, Helvetica, sans-serif;word-wrap:break-word;min-height:16px;background:#FFF;border:1px solid #d9d9d9;padding:10px;line-height:1.3;text-align:center;font-size:16px;color:#888;font-weight:700;cursor:pointer}
.menu_cent:active
{background:#f1f1f1;font-family:Arial, Helvetica, sans-serif;word-wrap:break-word;min-height:16px;background:#FFF;border:1px solid #d9d9d9;padding:10px;line-height:1.3;text-align:center;font-size:16px;color:#888;font-weight:700;cursor:pointer}
</code></pre>
<p>I had tried to use </p>
<pre><code><div class="m_10">
<a href="#" onclick="set_lng('en')"><div onClick="style.backgroundColor='#f1f1f1';" class="menu_cent">English</div></a>
</div>
</code></pre>
<p>it works but it comes with delay.</p>
<p>Please help</p>
|
javascript iphone
|
[3, 8]
|
721,110 | 721,111 |
Is it possible to modify application objects from web page in c#
|
<p>Had an interview and was asked if it is possible to modify Application Objects from Web page.
If not then is this what differentiates between <code>cache objects</code> and <code>application objects</code></p>
|
c# asp.net
|
[0, 9]
|
1,006,745 | 1,006,746 |
how to detect javascript features on Android 1.5
|
<p>I'm trying to write a code that can run on Android 1.5 and 2.0.1, but I have issues with the javascript engine used on Android 1.5.</p>
<p><code>alert(localStorage);</code> just hang on v1.5 while on v2.0.1 it alerts correctly.</p>
<p>is there an unblocking way to do it or to detect the version of Android with javascript?</p>
|
javascript android
|
[3, 4]
|
3,644,895 | 3,644,896 |
Issue in jQuery drag
|
<p>I am using the jQuery fancy product designer tool. In this tool when I drag the text or image, it is not smooth. That div shakes from position from left.</p>
<p>Following is the link: <a href="http://goo.gl/GcVo5" rel="nofollow">http://goo.gl/GcVo5</a></p>
<p>When you click on default text, then drag it, the div shakes. Please suggest a solution.</p>
|
javascript jquery
|
[3, 5]
|
402,879 | 402,880 |
disable tabbing on document but enable input tabbing?
|
<p>I have added the following code to my site to prevent tabbing, this applies to the whole document. Problem is that this obviously disables all tabbing throughout the site, how can I add a rule in to allow inputs to be tabbed? I tried adding .not('input') but this doesnt seem to work.</p>
<pre><code>$(document).keydown(function(objEvent) {
if (objEvent.keyCode == 9) {
objEvent.preventDefault();
}
});
</code></pre>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,698,334 | 4,698,335 |
Android: how to create Switch case from this?
|
<pre><code>public void onItemClick(AdapterView<?> a, View v, int position, long id) {
AlertDialog.Builder adb = new AlertDialog.Builder(CategoriesTab.this);
adb.setTitle("Selected Category");
adb.setMessage("Selected Item is = "+lv1.getItemAtPosition(position));
adb.setPositiveButton("Ok", null);
adb.show();
}
</code></pre>
<p>This at the moment displays an alertbox when an item from listview is clicked. I want to convert the alertbox to load a specific xml for each choices clicked. How can i do this?
thanks for your help.</p>
|
java android
|
[1, 4]
|
5,065,991 | 5,065,992 |
use XML loaded number as a function variable
|
<p>I need to use a variable from the code below in a link ID to load an overlay iframe. I'm loading numbers from an XML file that I'm using for each generated link parameter, I could use them as an ID too. Below is the javascript:</p>
<pre><code>$(function(){
$('#b1').frameWarp();
});
</code></pre>
<p>Instead of using ID="b1", am I able to create variables based on the loaded XML numbers?
I cannot use class instead of ID.</p>
|
javascript jquery
|
[3, 5]
|
2,539,225 | 2,539,226 |
Maintain page position while page length changes
|
<p>Let's say I have a situation like this:</p>
<ul>
<li>The page is 4000 pixels long.</li>
<li>The user has scrolled down the page, so 1000 pixels of content are hidden above the viewport.</li>
</ul>
<p>Then, the user clicks a button, and content of arbitrary length is loaded via AJAX at the top of the page, pushing the button (and the content the user was looking at) below the viewport. </p>
<p>I've tried writing a Javascript callback to scroll down to the content the user was looking at before they clicked the button, but the experience is not seamless (a scroll "up" when new content is inserted, followed by a scroll back "down").</p>
<p>Is there any way to keep the viewport fixed on the content the user was looking at?</p>
<p>This is a simplified example, but should get the point across.</p>
<pre><code><div style="height: 1000px; width:1000px;" id="top-div">some content above the fold</div>
<button id="button">Click Me</button>
<img src="img.jpg" alt="Some image the user was looking at when they clicked the button." />
<script>
$("button").click(function() {
$.get('/new/content', function(response) {
$("#top-div").before(response);
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,446,036 | 5,446,037 |
Difference between List<string> lst = new List() and List<> lst = new List()
|
<p>I just want to know the difference between <code>List<string> lst = new List()</code> and <code>List<> lst = new List()</code></p>
|
c# asp.net
|
[0, 9]
|
1,730,351 | 1,730,352 |
HttpWebRequest is very slow
|
<p>hi all am requesting a handler file from another handler file that returns an image,when i request my HttpWebRequest taking more time to get the response...here is my code please help.</p>
<pre><code>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpCookie cookie = context.Request.Cookies["ASP.NET_SessionID"];
Cookie myCookie = new Cookie(cookie.Name, cookie.Value);
myCookie.Domain = url.Host;
request.CookieContainer = new CookieContainer();
request.CookieContainer.Add(myCookie);
request.Timeout = 200000;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
responseStream = response.GetResponseStream();
</code></pre>
|
c# asp.net
|
[0, 9]
|
189,644 | 189,645 |
How do you write a custom jquery selector for all not shown fields excluding hidden fields
|
<p>I want to write a custom selector to select all fields that are returned by the :hidden selector except for the fields that are of type hidden. </p>
<p>Here's what I have. It's breaking the page with no console error.</p>
<pre><code>$.extend($.expr[':'], {
notShown: $(':hidden').not("hidden")
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,679,713 | 4,679,714 |
Make element absolute, but do not change its position on the screen
|
<p>I have an element that is relative positioned on the page, relative to its parent element.</p>
<p>How can I make this element absolute with jQuery.css, but without changing the actual position on the screen? It should stay in the same place, and it should be absolute relative to the document body</p>
<p>$.css('position', 'absolute') will re-position the element </p>
<p>If it can't be done, how can I change the x,y position of this element on the screen, relative to the document body (or the browser screen)?</p>
|
javascript jquery
|
[3, 5]
|
569,172 | 569,173 |
Listener to notify the completion of a series of events(starting simultaneous services)
|
<p>I have three classes from which I start three services. These three services will be started simultaneously.</p>
<p>I have callback methods in each of these service class to know whether that particular service has been started.</p>
<p>There is no order in which what service out of these three would get started first, though they are started simultaneously.</p>
<p>Can someone please let me know the best approach to use in order that I am notified at the start of last service?</p>
<p>Any help is appreciated.</p>
|
java android
|
[1, 4]
|
3,961,485 | 3,961,486 |
OnGenericMotionListener doesn't seem to be working
|
<p>This is really weird all other listeners work like onClick etc.. but this listener doesnt seem to be working, heres my code:</p>
<pre><code>public class HeloActivity extends Activity implements OnGenericMotionListener{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View root = findViewById(R.id.root );
root.setOnGenericMotionListener(this);
}
@Override
public boolean onGenericMotion(View v, MotionEvent event) {
// TODO Auto-generated method stub
Log.d( "special",v.toString() );
return false;
}
}
</code></pre>
<p>why is this not working?</p>
|
java android
|
[1, 4]
|
3,234,570 | 3,234,571 |
get selected value of radio button onclick of submit and pass value to a function
|
<p>I am doing some work in PHP. I have two php page</p>
<p>index.php</p>
<pre><code><html>
<head>
<script>
function getVote(int)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("poll").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","poll-vote.php?vote="+int,true);
xmlhttp.send();
}
</script>
</head>
<body>
<h3>Is this correct? </h3>
<div id="poll">
<form>
Yes:
<input type="radio" name="vote" value="0">
<br>No:
<input type="radio" name="vote" value="1">
<input type="submit" value="Forward" onclick="getVote(value);">
</form>
</div>
</body>
</html>
</code></pre>
<p>on click of submit button I need to get the value of selected radio button and pass it to the function.</p>
<p>Please help me</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,205,859 | 5,205,860 |
ASP.NET Databinding a DropDownList
|
<p>Greetings Gurus,</p>
<p>I have an ASP.Net app that I'm working on with a editable detailsview.
There is a boundfield in the detailsview called Status which I turned into a template field.</p>
<p>This templatefield (specifically the editItemTemplate) was changed to a dropdownlist with a unique datasource. How do I Bind this dropdownlist to the StatusField so my update query picks up it's value when I click update? </p>
<pre><code><EditItemTemplate>
<asp:DropDownList ID="DropDownListStatus" runat="server"
DataSourceID="Status_DataSource" DataTextField="Status" DataValueField="Status">
</asp:DropDownList>
</EditItemTemplate>
</code></pre>
|
c# asp.net
|
[0, 9]
|
120,939 | 120,940 |
Detect Close Browser in ASP.NET
|
<p>I have a ASP.NET web app with a MasterPage and contents page, from the MasterPage when I click a MenuItem to open a new aspx Page. if I want to close the new page browser tab, I want to show a popup or a dialog that alert the user that he is closing the browser tab. I used the following code in the new aspx page:</p>
<pre><code><script type="text/javascript">
$(window).bind("beforeunload", function () {
$(window).unbind("beforeunload");
return confirm("Do you really want to close?")
})
</script>
</code></pre>
<p>the problem is that if i press also other buttons than the browse closeTab the method works. i would like to know how can i avoid it.</p>
<p>thanx in advance. </p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
238,173 | 238,174 |
specific e-mail pattern control with javascript
|
<p>I've a textBox control and would like my users to <em>only</em> be able to enter <code>[email protected]'</code> or <code>'[email protected]'</code></p>
<p>How can I do this with a JavaScript function? The function must take a textbox value.</p>
|
javascript jquery
|
[3, 5]
|
3,905,191 | 3,905,192 |
What is the best method to retrieve the post value on another page in ASP.net 4.0
|
<p>I search on internet but did not find any best solution, i found one way, where you need to code html tags like </p>
<pre><code><input type='text'> ... etc etc
</code></pre>
<p>and retrieve that value on another page as</p>
<pre><code>Request.Form["name of input text field"];
</code></pre>
<p><a href="http://www.w3schools.com/asp/asp_inputforms.asp" rel="nofollow">W3Schools -ASP Forms and User Input</a></p>
<p>exists any better way to retrieve that post value??</p>
|
c# asp.net
|
[0, 9]
|
5,178,040 | 5,178,041 |
how to get text box value in page init?
|
<p>I am using asp.net 2.0</p>
<p>I set a hidden text box from javascript and on postback, i want to check the value stored on the text box in page init event. Here is what i tried</p>
<pre><code>string t = Request.Form["currentMode"].ToString();
</code></pre>
<p>but i get an error saying " Object reference not set to an instance of an object."</p>
<p>Any idea?asp.</p>
|
c# asp.net
|
[0, 9]
|
1,521,957 | 1,521,958 |
jQuery Slideshow won't Loop
|
<p>I know that similar questions have been asked before, but I am very much a rookie with my jQuery, and I cannot seem to get any of the solutions to work, so please forgive my naivety. I have created a very simple slideshow, but when the last slide is shown, it does not loop back to the beginning, it simply fades out. How can I make it loop continuously?</p>
<pre><code>$(document).ready(function(){
$(".featured > div:gt(0)").hide();
setInterval(function() {
$('.featured > div:first')
.fadeOut(2000)
.next()
.fadeIn(2000)
.end()
.replaceWith();
}, 4000);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,849,111 | 4,849,112 |
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]
|
3,606,810 | 3,606,811 |
adding two numbers in a session
|
<p>I am doing a web application in ASP.net / C# where a random number (num1) is generated on a Page_Load event. In the web page there is a button, whenever the user clicks that button a new random number (num2) is generated and it is added (+) to the previous one in a Button_Click event. This keeps on going infinitely (keep on adding a new random number to the last addition). I have tried using sessions I did not find a clear example. I would really appreciate your suggestions and help. </p>
<p>Code:</p>
<pre><code>private static Random random = new Random();
private int randomNumber(int min, int max)
{
return random.Next(min, max);
}
protected void Page_Load(object sender, EventArgs e)
{
number1 = randomNumber(1, 10);
}
protected void Button1_Click(object sender, EventArgs e)
{
int number2 = randomNumber(1, 10);
Session["number_x"] = number2;
number2 += number1;
}
</code></pre>
<p>Lets say on the page_load the random number generated is 4. The user then clicks the button which generates a new random number lets say 5. Now 5 should be added to 4 = 9. If the user again clicks the button generating again a new number say 5, so now the session should have 14 and so on. </p>
<p>Thanks. </p>
|
c# asp.net
|
[0, 9]
|
2,764,138 | 2,764,139 |
How to load a html page in a jquery dialogbox.?
|
<p>I have created a dialog box and i want to load a HTML page into it h</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.