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
3,003,024
3,003,025
Accessing SessionState in IHttpModule after 404?
<p>Is it possible to access SessionState in the Error event handler of a HttpModule following a 404?</p> <p>Im trying to implement a consistent error handling mechanism for both full and partial postbacks using the technique described in this blog post,</p> <p><a href="http://blogs.microsoft.co.il/blogs/oshvartz/archive/2008/05/17/asp-net-error-handling-using-httpmodule-full-and-partial-post-back-ajax-updatepanel.aspx?CommentPosted=true#commentmessage" rel="nofollow">ASP.NET Error Handling......</a></p> <p>Instead of passing loads of parameters on the query string im trying to push the exception into session state and access it from the error page. </p> <p>SessionState is never available at point I do my Server.Transfer (in error handler of HttpModule) so not available to error page.</p> <p>Ive tried the trick of resetting the IHttpHandler to one with the IRequestSessionState interface but no joy.</p> <p>Thanks in advance,</p> <p>EDIT - The code of the IHttpModule error handler is,</p> <pre><code>void context_Error(object sender, EventArgs e) { try { var srcPageUrl = HttpContext.Current.Request.Url.ToString(); // If the error comes our handler we retrieve the query string if (srcPageUrl.Contains(NO_PAGE_STR)) { // Deliberate 404 from page error handler so transfer to error page // SESSION NOT AVAILABLE !!!! HttpContext.Current.ClearError(); HttpContext.Current.Server.Transfer(string.Format("{0}?ErrorKey={1}", ERROR_PAGE_URL, errorKey), true); } else HttpContext.Current.Server.ClearError(); return; } catch (Exception ex) { Logging.LogEvent(ex); } } </code></pre> <p>Matt</p>
c# asp.net
[0, 9]
3,053,818
3,053,819
Replacing occurence of character in a string with jquery
<p>I need to replace occurrence of very <code>\</code> with <code>-</code> in a string. I am using the following code but it replace only for once occruence:</p> <pre><code>var start = '1/1/12'; startNew = start.replace('/', "-"); </code></pre> <p>Result i am getting is: <code>1-1/12</code></p> <p>Result i want is: <code>1-1-12</code></p>
javascript jquery
[3, 5]
5,257,963
5,257,964
Where is the other half of the _Default partial class that is created when you create a webform?
<p>When you add a webform, you get a file called Default.aspx.cs </p> <pre><code>public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } </code></pre> <p>Where is the other half of it?</p>
c# asp.net
[0, 9]
5,013,275
5,013,276
Prevent calling a function
<p>I have two parts of scripts.</p> <hr> <pre><code>Part 1 : $("mySelector").click(function() { alert('you call me'); }) </code></pre> <hr> <pre><code>Part 2 : $("mySelector").click(function() { if(myCondition) { //how can i prevent calling the first function from here ??? } }) </code></pre> <p>The whole problem, is that <strong>i have no access to part1</strong>. So i need to unbind the event allready specified in part 1, if myCondition is true, but otherwise i need to call the first function.</p> <p>Thanks</p> <p><strong>UPDATE:</strong></p> <p>Thank you. I didn't know about stopImmediatePropagation(). But i feel, that there must be something like that :)</p> <p>But actually in my case it doesn't work :(</p> <p>Please have a look at my site <a href="http://www.tours.am/en/outgoing/tours/%D5%80%D5%B6%D5%A4%D5%AF%D5%A1%D5%BD%D5%BF%D5%A1%D5%B6/Park-Hyatt-Goa/" rel="nofollow">http://www.tours.am/en/outgoing/tours/%D5%80%D5%B6%D5%A4%D5%AF%D5%A1%D5%BD%D5%BF%D5%A1%D5%B6/Park-Hyatt-Goa/</a></p> <p>Under the <strong>hotel description</strong> tab i have cloud carousel, when i click on not active image (not the front image), as you can see i'm consoling that i stopImmediatePropagation() there, but the event however calls :(</p>
javascript jquery
[3, 5]
1,324,441
1,324,442
How to display image based on variable in url
<p>I am using gallerific <a href="http://www.twospy.com/galleriffic/" rel="nofollow">http://www.twospy.com/galleriffic/</a> to display thumbnails and large images when a user clicks a thumbnail. You can see it in action here <a href="http://kimmelkids.com/kimmelkids/gallery/view-gallery/" rel="nofollow">http://kimmelkids.com/kimmelkids/gallery/view-gallery/</a></p> <p>My question is I know jquery can grab variables from the url and that is how gallerific changes images. But when I put in the url <a href="http://kimmelkids.com/kimmelkids/gallery/view-gallery/#leaf" rel="nofollow">http://kimmelkids.com/kimmelkids/gallery/view-gallery/#leaf</a> into the address bar it should go to the image in the gallery but it doesn't. </p> <p>Is there any way to have gallerific pull up the image based on the url enter into the address bar?</p>
javascript jquery
[3, 5]
4,773,197
4,773,198
Getting value from JS to PHP
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1599675/how-to-pass-value-from-javascript-to-php-and-get-return-of-php-back-to-javascript">How to pass value from Javascript to PHP and get return of PHP back to Javascript</a> </p> </blockquote> <p>how to get value from</p> <p>JS:</p> <pre><code>var vars=""; </code></pre> <p>and add it into PHP</p> <pre><code>$vars=""; </code></pre> <p><code>Vars</code> contains only digits.</p>
php jquery
[2, 5]
5,430,789
5,430,790
Single page temporary PHP file upload
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery">How can I upload files asynchronously with JQuery?</a> </p> </blockquote> <p>What are the best practices (if any) for allowing a user to select a file and have the contents sent to javaScript(jQuery) in a single page and asynchronously?</p> <p>HTML:</p> <pre><code>&lt;form action="" method="post" enctype="multipart/form-data"&gt; &lt;input type="file" name="file" id="file" /&gt; &lt;input type="submit" name="submit" value="Upload" /&gt; &lt;/form&gt; </code></pre> <p>JS/JQUERY:</p> <pre><code>$.document.ready(function(){ var txtString = new String(); //set the var to &lt;?php [$_FILE]["file"]["data"] ?&gt; } </code></pre> <p>I'm only using the data to kick off some javaScript so I shouldn't need to move the file out of the temp folder. I'm having a hard time figuring out where to put the PHP to send the file data to javaScript. Any suggestions would be much appreciated!</p>
php javascript jquery
[2, 3, 5]
5,722,335
5,722,336
Javascript Class - Cannot set a property
<p>I have the below code to create a class in javascript.... Now i will only pass the ID of the 'website' and then via an ajax call i will get the rest of the information from the database (JSON ENCODED).</p> <p>Now my only problem is that when i see whats in the object at the end its only showing the id.</p> <p>The ajax calls works fine because if i alert this.address after success (ajax) its displaying the result.</p> <p>What I presume is that I cannot set a property with an ajax request... Can you help?</p> <pre><code>function website(id) { this.id = id; //id $.ajax({ //website_information type: "GET", url: '/proc.php?proc=website_name&amp;id=' + this.id + '', success: function(data){ var tmp = $.parseJSON(data); this.address = tmp.website_address; this.name = tmp.website_name; } }); } var obj = new website('20'); obj.alertwebsite(); console.log(obj); </code></pre>
javascript jquery
[3, 5]
5,280,271
5,280,272
android ensuring safety
<p>I am making app, which would send value to php script. Then php script would conncect to Mysql database and return JSON array. And then the app would read it. How to ensure safety? For now I am not using any safety measures.</p>
java php android
[1, 2, 4]
4,108,070
4,108,071
how to serialize HashSet
<p>i'm building an android app and i want to add a history function. I heard that i can serialize a list to be able to save and retrieve data instead of using a Database, i have no idea how it works so i come here and ask for advice, is there somewhere i could get started with this. Some good links could be useful. </p> <p>Thanks</p>
java android
[1, 4]
2,388,945
2,388,946
two JS variables refer to same Json object how to keep one constant?
<p>I have </p> <pre><code> $.getJSON('json.ashx?mode=Gender', function (data) { memberInfo = data[1]; options.series = data; originalData = data[0]; ... ... }); </code></pre> <p>which returns</p> <pre><code>[ {"type" : "pie","name" : "Gender", "data" : [["Male",32],["Female",11]]}, {"A123":"F","A223":"M","A423":"F","A332":"M","B327":"F"} ] </code></pre> <p>and</p> <pre><code> function calcOptionsData() { ... var maleCount = 0; var femaleCount = 0; ... ... $.each(val, function(index, item) { if (memberInfo[item] == 'M') maleCount += 1; if (memberInfo[item] == 'F') femaleCount += 1; }); options.series[0].data[0][1] = originalData.data[0][1]; options.series[0].data[1][1] = originalData.data[1][1]; if (radioBttnClicked == 'Gender') { options.series[0].data[0][1] += maleCount; options.series[0].data[1][1] += femaleCount; } } </code></pre> <p>I want every times the calcOptionsData() called the originalData resets the options.series[0].data to the value originally generated from the getJSON. The current code mirrors originalData with options.series[0].data.</p> <p>Thanks,</p>
javascript jquery
[3, 5]
1,169,795
1,169,796
java generic how to use generic in constructor
<pre><code>public class DbManager&lt;T extends Dao&gt; { public DbManager(Context c) { setCreateDatabaseScript(T); } public void setCreateDatabaseScript(T dao) { this.createDatabaseScript = ((Dao)dao).createTable(); } //.. } </code></pre> <p>how can I inside constructor call setCreateDatabaseScript. I try like in example but not working. What is correct syntax?</p>
java android
[1, 4]
147,090
147,091
jquery exclude data out of object when sending via ajax
<p>I am sending post data via ajax, and that data looks like this:</p> <pre><code>var cardProperties = { container: $("#cardContainer"), elementsWrapper: $("#cardElementsWrapperBorder"), size: 0, //0 -&gt; (90x50mm &lt;-&gt; 510px x 283px), 1-&gt; (85x55mm &lt;-&gt; 482px x 312px) position: "h", //default horizontal bgImagesPath: "media/images/designs/backgrounds/", //path to card bg images floatingImagesPath: "media/images/designs/floating-images/", //path to card bg images imagesPerPage: 8, innerBorderMargins: 40, //this should be divided by 2 to get the actual margin currentCardSide: 1 }; </code></pre> <p>So basicly there is some usual data, but fields like <code>container</code> or <code>elementWrapper</code> is probably containing a lot of information about that object and also it's child objects, so this is causing me very ugly error <code>Uncaught RangeError: Maximum call stack size exceeded</code> and since i don't need those two fields how could i exclude it from the object without deleting any of that info, since i will need that stuff later in my <code>js</code> script.</p> <p><strong>EDIT</strong></p> <p>Also here is my <code>ajax</code> code:</p> <pre><code>$.post("server.php", {data: cardProperties}, function(response){ } ); </code></pre>
javascript jquery
[3, 5]
3,820,020
3,820,021
How to pass javascript object from one page to other
<p>I want to pass javascript object from one page to other page so anyone can tell me how to do it?</p> <p>Is that possible to do so using jQuery?</p>
javascript jquery
[3, 5]
795,233
795,234
How can I pass Collection to modal dialog window?
<p>I want to know, if its possible to pass collection between pages. I mean to say i have a client-side JavaScript modal dialog on which I want to use my collection. Earlier I was using Session[] to share the value, but its becoming evil for me, as it always displays the first value. Any change in value in not updated. </p> <p>So whenever my pop up is displayed I want the collection to get moved to the Child dialog. From there, i will extract the Collection, do some stuffs and again return it to parent page, preventing postbacks and session management.</p> <p>I think i am clear to you guys. If not clear, please add comment.</p>
c# javascript asp.net
[0, 3, 9]
5,368,160
5,368,161
How can we use JQuery in asp.net pages?
<p>How can we use JQuery in asp.net pages?</p>
asp.net jquery
[9, 5]
679,447
679,448
insertAdjacentHtml in jquery
<p>for some reason when using insertAdjacentHtml function in FF I am getting insertAdjacentHTMl is not a function error, is there an alternative to this in jQuery or some other alternative javascript function?</p>
javascript jquery
[3, 5]
5,152,042
5,152,043
Advance search system in asp.net web pages
<p>Is it possible to create advance search option like that of google page in asp web pages. To be more clear. il give the example of my requirement.</p> <p>In google home page. if in the textbox you type IN.. below you will get various options that start with IN like INDIA,INNOVA etc.</p> <p>Is it possible to do in asp web page where the code is in C#.</p> <p>Also is it possible to use it without using Ajax or any other higher level architecture programs.??</p> <p>Thank you.</p>
c# asp.net
[0, 9]
2,790,692
2,790,693
PHP command shell_exec() not working for my custom Java app5
<p>I have made a custom java program to output a license and am trying to run it in php.</p> <pre><code>$deviceid="12345"; $command_app = 'java -jar /home/myname/secure/mycommand.jar '; $privateKey = 'QEFAASCAmEwggJdAgE'; $command_app_args = "\"$privateKey\" deviceid=$deviceid"; $command=$command_app.$command_app_args; $license = shell_exec($command); </code></pre> <p>The problem is that $license is empty every time, I tried to print out the $command using </p> <pre><code>echo $command; </code></pre> <p>and then ran that command directly in the linux terminal and the xml output was correct.</p> <p>I am using </p> <pre><code>System.out.println() </code></pre> <p>in the java app to print all the xml output. I tried something simple like </p> <pre><code>shell_exec('ls -l') ; </code></pre> <p>and sure enough if worked.</p> <p>What might I be doing wrong?</p>
java php
[1, 2]
81,443
81,444
frame by frame animation not running
<p>well,i am a newbie to android..and i dont know whats wrong in my code..</p> <p>this is my xml file</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android" id="selected" android:oneshot="false"&gt; &lt;item android:drawable="@drawable/w1" android:duration="50" /&gt; &lt;item android:drawable="@drawable/w2" android:duration="50" /&gt; &lt;/animation-list&gt; </code></pre> <p><strong>my java file</strong></p> <pre><code>ImageView img = (ImageView)findViewById(R.id.s); img.setBackgroundResource(R.anim.shape_animation); </code></pre> <p><br/></p> <pre><code>// Get the background, which has been compiled to an AnimationDrawable object. AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground(); </code></pre> <p><br/> </p> <pre><code>// Start the animation (looped playback by default). frameAnimation.start(); </code></pre>
java android
[1, 4]
2,452,116
2,452,117
Is it good to switch from c# to python?
<p>Currently I am developing in the .Net environment using C# but I want to know whether it is worth learning python. I'm thinking of learning the Django framework. What is better?</p>
c# python
[0, 7]
1,136,654
1,136,655
access HttpPostedFile without saving, get error "Request for the permission of type 'System.Security.Permissions.FileIOPermission..."
<p>Can we access HttpPostedFile's uploaded file without saving the file. I am trying to read file's name and size but get error <strong>"Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</strong>"</p> <p>It works well on local host but this error accure on shared hosting server (GoDaddy). Please guide me a solution. I need to read some properties of files before saving it.</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,311,446
2,311,447
$.ajax and ashx page
<p>I am using the following code to store values in aspx session.</p> <p>Code:</p> <pre><code> $("div.menu_body a").click(function() { var linkHeaderID = $(this).parent().attr("id"); $.ajax({ type: "GET", url: "SessionHandler.ashx", data: "headerLink=" + linkHeaderID + "&amp;link=" + this.id }); }); </code></pre> <p>Problem:</p> <p>For the first 3 to 5 selection of link is working properly. After that the control is not hitting the SessionHandler.ashx page.</p> <p>Regards, Geetha.</p>
c# asp.net jquery
[0, 9, 5]
974,397
974,398
Change text of link
<p>I have a following HTML</p> <pre><code>&lt;h2&gt; &lt;a href="Controller/Method" onclick="Increment_Visits(10)"&gt;ABC&lt;/a&gt; &lt;/h2&gt; &lt;a href="#" id="10"&gt;Visits(10)&lt;/a&gt; </code></pre> <p>And following is JS</p> <pre><code>function Increment_Visits(id) { var element = document.getElementById(id); var incremented_visits = parseInt(element.innerHTML())++; element.innerHTML(incremented_visits); } </code></pre> <p>I want that when user clicks first link i.e. in <code>&lt;h2&gt;</code> tag, then before redirecting to next page, no of visits should be incremented and then redirection to other page. Pls help me, it is not working.</p>
javascript asp.net
[3, 9]
4,748,782
4,748,783
Move cursor at the end of the input
<p>This is my little jquery plugin that replaces each english symbol with other symbols while typing. Everything works fine here except when I type a long word, longer than the input itself, the cursor goes outside the input the the last part of the word isn't visible. Just visit the link bellow and type something (without the space) and you'll get what I mean.</p> <p><a href="http://jsfiddle.net/beLMf/" rel="nofollow">http://jsfiddle.net/beLMf/</a></p> <p>Is there any solution to fix this?</p>
javascript jquery
[3, 5]
2,833,964
2,833,965
JavaScript: Get full path of an uploaded file
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepath">how to resolve the C:\fakepath?</a> </p> </blockquote> <p>Can I get full path of an uploaded file using JavaScript? I tried asyncfileuploder but I am getting file name only. How to get full path using JavaScript? Also, how can I get full path with different methods?</p> <pre><code>&lt;ContentTemplate&gt; &lt;cc1:AsyncFileUpload runat="server" ID="uploadExcelFle" UploaderStyle="Modern" ThrobberID="imgLoader" OnClientUploadStarted="uploadClientStarted"/&gt; &lt;/ContentTemplate&gt; function uploadClientStarted(sender, args) { var fileName = args.get_fileName(); var fileExt = fileName.substring(fileName.lastIndexOf(".") + 1); var filePath = args.get_path(); } </code></pre>
javascript asp.net
[3, 9]
2,022,181
2,022,182
javascript: alt attribute with special characters
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2775328/alt-attribute-encoding-with-javascript">Alt attribute encoding with JavaScript</a> </p> </blockquote> <p>I can't seem to assign special characters using javascript in alt tags and have them render in any browser.</p> <p>Without javascript, special characters in alt tags render fine (Pepsi&trade;):</p> <p><code>&lt;img id="pic" src="path/to/image.jpg" alt="Pepsi&amp;trade;" /&gt;</code></p> <p>However, when assigning this same value via javascript or jquery you get (Coke<code>&amp;trade;</code>).</p> <p><code>$("#pic").attr("alt","Coke&amp;trade;")</code> or <code>image = document.getElementById('pic'); image.alt="Pepsi&amp;trade;"</code></p> <p>This issue exists in chrome and IE6; I haven't tried other browsers. Any ideas?</p>
javascript jquery
[3, 5]
24,881
24,882
In JavaScript is it possible to add to a callback function instead of overwriting it?
<p>I don't know if I'm saying this right, so I'll just ask by explaining with an example. </p> <p>Let's say I've written a jQuery plugin with an <code>onShowEdit</code> callback.</p> <p>I later use my plugin and add a bunch of other default functions/methods to the event:</p> <pre><code>$('.editable_module:not(.custom)').editable({ onShowEdit: function(el){ initRequired(); $(':radio, :checkbox', el).prettyCheckboxes(); initDatePickers(); initChosen(); initMaskedInputs(); $('.dynamic_box.tabs').dynamicBoxTabs(); $('.trigger_dynamic_box').triggerDynamicBox('true'); } }); </code></pre> <p>So now I have a basic/default element (<code>.editable_module</code>) that calls the plugin and has some methods/functions that are going to be used in all instances. </p> <p>My question comes when I have a need to add something to this for a 'one time' kind of deal (I need to add some behavior to this callback/event but not something that is used normally). Is it possible to extend or add to this callback/event without overwriting it? I mean, I know I can go in and do this:</p> <pre><code>$('#new_selector').editable({ onShowEdit: function(el){ initRequired(); $(':radio, :checkbox', el).prettyCheckboxes(); initDatePickers(); initChosen(); initMaskedInputs(); $('.dynamic_box.tabs').dynamicBoxTabs(); $('.trigger_dynamic_box').triggerDynamicBox('true'); //ADD SOME NEW STUFF HERE } }); </code></pre> <p>But is that really my only option?</p> <p>Thanks in advance for any input/suggestions.</p>
javascript jquery
[3, 5]
3,420,611
3,420,612
How to send, receive and store references to external Methods
<p>In a custom Class I'm trying to execute functions that are given externally via parameters.</p> <p>It is important for me not to have to store any reference to parent classes or such, only the methods/functions to be called.</p> <p>I tried sending a Method as a parameter but it isn't working.</p> <pre><code>class A // var to store reference to external method private Method myMethodReference; // (says error: never used) // the setter to store the reference to the external method public void setMethodReference(Method someMethod) { myMethodReference = someMethod; } public boolean someFunctionWithinMyClass() { // call the external method via my reference myMethodReference(); // (says error: The method myMethodReference() is undefined) } </code></pre> <hr> <p>Also, when I try to set the reference to the method from the external class, it doesn't work:</p> <pre><code>class B public void someFunction() { Log.i("la", "la" }; instanceOfClassA.setMethodReference(someFunction); // (says error: variable someFunction not found) </code></pre> <hr> <p>So even passing the reference doesn't work because Eclipse assumes someFunction is a variable that is not in the scope.</p> <p>I hope this explains it better!</p>
java android
[1, 4]
5,240,429
5,240,430
How to generate c# class file from c# code behind?
<p>Is it possible to create a class (classname.cs) file at runtime and use the class runtime. If it is then how to implement. please help.</p>
c# asp.net
[0, 9]
3,974,073
3,974,074
Style property of custom asp.net control throws exception when set
<p>I have written custom control that inherits from System.Web.UI.Control. I have added Style property like this:</p> <pre><code>public class MyControl : Control { public CssStyleCollection Style { get { return ViewState["Style"] as CssStyleCollection; } set { ViewState["Style"] = value; } } } </code></pre> <p>And I use it the following way</p> <pre><code>&lt;custom:MyControl runat="server" Style="float: left; padding: 2px 4px;" ... /&gt; </code></pre> <p>When I attempt to load the page, I receive the following exception:</p> <blockquote> <p>Cannot create an object of type 'System.Web.UI.CssStyleCollection' from its string representation 'float: left; padding: 2px 4px;' for the 'Style' property.</p> </blockquote> <p>I suppose I should add a TypeConverter attribute to the property or something, but I could not find appropriate one in the System.Web.UI namespace. I also searched google and there was not much information for exactly this issue. I know that if I extended <code>WebControl</code> but I'd prefer a solution that deals with <code>Control</code>.</p>
c# asp.net
[0, 9]
4,146,623
4,146,624
How does jquery return functions like success and error
<p>I've looked though the jquery code, and it's not clear to me. How do I make my own function return success or error like in the following code:</p> <pre><code> $.ajax({ type: "GET", url: "/some.xml", success: function() { /** found! **/}, error: function(xhr, status, error) { if(xhr.status==404) { /** not found! **/} } }); </code></pre>
javascript jquery
[3, 5]
1,599,307
1,599,308
jQuery error blocking another script from firing in asp.net
<p>I am using fancybox script as a widget to show videos as modal for "Most Popular" Widget section of the website.</p> <p>Script used for this widget is creating problems for another on almost all the page &amp; block jquery plugin from shows multiple image as slider (<a href="http://showcase.awkwardgroup.com/" rel="nofollow">http://showcase.awkwardgroup.com/</a>).</p> <p>LINK FOR WEBSITE PAGE with error : <a href="http://tinyurl.com/cd32cn" rel="nofollow">http://tinyurl.com/cd32cn</a></p> <p>error message: <code>TypeError: $(...).awShowcase is not a function</code> using debugger.</p> <p>I would appreciate help to resolve this issue so that all the image will work as shown in this link <a href="http://showcase.awkwardgroup.com/" rel="nofollow">http://showcase.awkwardgroup.com/</a></p> <p>If i remove the user Control for <code>Most Popular</code> then page works fine</p>
jquery asp.net
[5, 9]
4,734,789
4,734,790
JQuery 1.3 upgrade considerations
<p>I hear nothing but great things about the newest version of jQuery 1.3. Has anyone experienced any problems upgrading from 1.2.6? I would love to use it but I want to know if there are any gotchas first.</p> <p>EDIT: 1.3.1 is out. </p>
javascript jquery
[3, 5]
3,400,842
3,400,843
How do I use "this" as a part of a selector?
<p>I tried to do it this:</p> <pre><code>$(this + ' li:not(:nth-last-child(2)):not(:last-child)').hide() </code></pre> <p>Full code sample:</p> <pre><code>$('.comments').each(function(){ $(this + ' li:not(:nth-last-child(2)):not(:last-child)').hide() var template = $('#expand').html(); $(this).prepend(template) }); </code></pre> <p>I need to run it as an "each"-function because I want to put in a conditional later. </p>
javascript jquery
[3, 5]
3,568,087
3,568,088
Is there a way to execute a block of code during any uncaught exception?
<p>I realize this is a shot in the dark and not the best practice or way of going about it, but I want to do specific logging information as the exception is thrown. It is important that the state of the web form does not change. </p>
c# asp.net
[0, 9]
4,803,223
4,803,224
Using jQuery to clone form elements with dynamically added values
<p>I have a form that is similar to this:</p> <pre><code>&lt;fieldset id="user"&gt; &lt;input type="text" id="firstName"&gt; &lt;input type="text" id="lastName"&gt; &lt;/fieldset&gt; </code></pre> <p>Then I do an Ajax call to fill the values of those two fields. At this point I want to save the current state of the form (with the populated values) in case the user needs to revert back after making a change.</p> <p>I've tried this:</p> <pre><code>$("#user").clone(true).html() </code></pre> <p>As well as this:</p> <pre><code>$("#user").html() </code></pre> <p>both return the original html from the dom that was created before the fields were populated. Is there a way to grab the html with the values after they have been populated with JS?</p>
javascript jquery
[3, 5]
4,463,581
4,463,582
How to call javascript function from code behind?
<p>I want to execute javascript function from code behind page.</p> <p>I have two way that first that I can call javascript of html page in my code behind.</p> <p>second is that i can write javascript function in to my code behind.</p> <p>but i am not which one is better and how can i do this.</p> <p>Please tell me that how can i do this.</p>
asp.net javascript
[9, 3]
4,707,363
4,707,364
Create an image cloud
<p>I want to create an image cloud where images are stacked with each other and resize according to the number of times the image has been seen. </p> <p>The cloud probably takes a predefined space too. Is it possible with javascript or do I need to go for SVG/Canvas?? </p> <p>Something similar to this: <a href="http://hitlantis.com/" rel="nofollow">hitlantis</a></p> <p>Any pointers / references would be nice. </p>
javascript jquery
[3, 5]
1,170,136
1,170,137
Removing and then adding item to div forces page view back to top
<p>A (hopefully) quick question: I'm trying to remove an element from the page, and then add a new element back in it's place.</p> <pre><code>jQuery("#branding").fadeOut("slow", function() { jQuery("#branding").empty(); jQuery("#branding").append("&lt;a class='headerimg' href='/'&gt;&lt;/a&gt;"); jQuery("#branding .headerimg").append(imageElement); jQuery("#branding").fadeIn("slow", function() { self.working = false; }); }); </code></pre> <p>All is well and good up to this point. The old element is removed, the new one is inserted. However, if you are scrolled down on the page it will force your browser back to the top every single time. Thoughts?</p>
javascript jquery
[3, 5]
2,941,415
2,941,416
Asp.net + C#: Copy DataColumn from tableA to table B
<p>I would like to copy DataColumn from tableA to table B:</p> <p>As I think it should be like this:</p> <blockquote> <p>TableA in perdefined.</p> <p>DataColumn[] dataColum = new DataColumn[TableA .Columns.Count];</p> <p>TableA .Columns.CopyTo(dataColum, 0);</p> <p>DataTable TableB = new DataTable();</p> <p>TableB .Columns.AddRange(dataColum); // </blockquote> <p>=> but it raised an error at the line error, ID is belong to another table (in tableB)...</p> <p>As I dont like another way:</p> <blockquote> <p>DataTable TableB = TableA.Copy(); TableB.Clear(); // => getting structure of table A, not nice this way</p> </blockquote> <p>Any ideas? Thanks in advance!</p>
c# asp.net
[0, 9]
5,385,375
5,385,376
window.onbeforeunload: Is it possible to get any details about how the window was unloaded?
<p>I'm developing one of those warning windows that tells the user that they may have unsaved data, but I only need it to warn them if they're leaving the page. Currently it does so on refreshes, postbacks, etc. I was wondering if there was any way to tell how the page was unloaded or otherwise get more details about what the user is doing to unload the page. (jquery solutions welcome).</p> <p>Code for reference:</p> <pre> window.onbeforeunload = function () { if (formIsDirty) { formIsDirty = false; return "Are you sure you want to navigate away from this page?"; } } </pre>
javascript jquery
[3, 5]
2,804,093
2,804,094
jquery capture the word value
<p>Is there a way to capture word value with jquery or javascript? in the example :</p> <p>Search: Quotes of the Month for May</p> <p>When I click "Search:" or "Quotes" or any word, that I alert that word text?</p> <p><strong>Update :</strong></p> <p>This is what I meant :</p> <p><a href="http://jsfiddle.net/BE68L/" rel="nofollow">http://jsfiddle.net/BE68L/</a></p> <p>Is there a way I can get text value without wrapping it into some html element?</p>
javascript jquery
[3, 5]
1,457,336
1,457,337
Find user-control's control from another user-control in same page
<p>I have created an <code>usercontrol</code> that has <code>treeview</code> inside.<br/><br/> Now I have placed it in an <code>aspx page</code> twice with some different <code>Id</code> let us say <code>usercontrolA</code> and <code>usercontrolB</code>.<br/><br/> Both of them are loaded in to page one by one.<br/> Now in <code>pre-render event</code> of <code>usercontrolA</code> I want to get the object of <code>treeview</code> control of <code>usercontrolB</code>.<br/><br/> How can I achieve it?<br/></p>
c# asp.net
[0, 9]
600,956
600,957
how do not duplicate a action in jquery
<p>js:</p> <pre><code> $(".test").focusout(function(){ var qtdCont = parseInt($(this).val()); if(qtdCont &gt; 0) { var qtdProd = $(".value").val(); var qtdProdInt = parseInt(qtdProd); var qtdProdTot = qtdProd-qtdCont; $(".value").val(qtdProdTot); } }); </code></pre> <p><strong>Demo:</strong> <a href="http://jsfiddle.net/dNEmD/18/" rel="nofollow">Jsfiddle</a></p> <p>i need the subtract only the fist time when he lose the focus.</p> <p>because if u go's back and focusout again, the subtraction (obviously) will happen again.</p> <p>how can i control that ?</p> <p>thank you.</p>
javascript jquery
[3, 5]
5,862,735
5,862,736
Deciding on User Control to Use at Runtime
<p>I have 2 user controls defined on a page:</p> <pre><code>&lt;%@ Register Src="Foo.ascx" TagName="FooControl" TagPrefix="acme" %&gt; &lt;%@ Register Src="Bar.ascx" TagName="BarControl" TagPrefix="acme" %&gt; . . . &lt;acme:FooControl ID="myFoo" runat="server" Visible="false" /&gt; &lt;acme:BarControl ID="myBar" runat="server" Visible="false" /&gt; </code></pre> <p>At runtime, I'd like to set one of the user control's properties in various locations in the page's code. For example:</p> <pre><code>protected void SomeMethod() { if (isSomeCondition) { myFoo.Visible = true; } else { myBar.Visible = true; } // ... if (somethingElse) { if (isSomeCondition) { myFoo.Prop1 = 123; } else { myBar.Prop1 = 123; } } // ... } </code></pre> <p>I know that I can have the 2 user controls inherit from a common Interface, but is there another (possibly better) way?</p>
c# asp.net
[0, 9]
345,792
345,793
Wait for file to exist in ASP.NET
<p>I have an ASP.NET page, where the user is able to trigger a console app on our server, which generates a file. What I want is the user to see a message that states 'Requesting file', then as soon as the file becomes available (i.e. <code>File.Exists</code> for the file returns true), the Requesting file message will change to a link of the file.</p> <p>Is this easy to accomplish in ASP.NET?</p>
c# javascript asp.net
[0, 3, 9]
981,831
981,832
Generate 3 dimension dynamic array in jquery
<p>How can I generate 3 dimension dynamic array in jquery, ( the length if the array should be dynamic and feed in from a variable )?</p>
javascript jquery
[3, 5]
5,953,641
5,953,642
Inputing results to inArray from .html (or innerHtml) and making it work
<pre><code>$("form").submit(function () { if ($.inArray($("input:first").val().toUpperCase(), ["UNITED STATES", "USA", "AMERICA"]) &gt; -1) { //function here }); &lt;div class="answers"&gt;"UNITED STATES", "USA", "AMERICA"&lt;/div&gt; $("form").submit(function () { if ($.inArray($("input:first").val().toUpperCase(), [$(".answers").html()]) &gt; -1) { //function here }); </code></pre> <p>Within the div with the class answers I have the results I need to validate. When I use jquery function .html the results print out fine, but when it validates it needs to validate the whole sentence : "UNITED STATES", "USA", "AMERICA" not every answer on its own like it does on the first function. How can I make this work?</p>
javascript jquery
[3, 5]
3,652,688
3,652,689
Using global resource in JavaScript
<p>I want to use global resource in my javascript code. Normally, when the code is inside the ASP code, I use <code>&lt;%=GetGlobalResourceObject("Resource", "MONTHS_SHORT1") %&gt;</code> and it works. But, when the javascript code is not inside the ASP code, for example in a folder as calendar.js, it does not work. How can I use the global resource in this case? Note: The resource file is inside my App_GlobalResources folder.</p>
javascript asp.net
[3, 9]
2,561,771
2,561,772
How to access my form values in document.ready
<p>I am new to javascript and have a very basic question:</p> <p>I have this in my HTML</p> <pre><code>Total Cost: &lt;input type="text" name="total" id="total" class="MyInput" /&gt; </code></pre> <p>I want to assign a value to this textbox at the program startup, for that I am using <code>document.ready</code>, but its not working.</p> <pre><code>&lt;SCRIPT LANGUAGE="JavaScript"&gt; $(document).ready(function() {{ $("#total").value = "2"; }); </code></pre> <p>What is the correct way of doing this?</p>
javascript jquery
[3, 5]
3,971,780
3,971,781
find id of tr in datalist
<p>I had table indatalist and I had to find id of tr in table I did my code but error apeared (object refrence...).</p> <p>aspx:</p> <pre><code>&lt;asp:DataList ID="DataList2" runat="server" RepeatColumns="4" RepeatDirection="Horizontal" onitemdatabound="DataList2_ItemDataBound"&gt; &lt;ItemTemplate&gt; &lt;table width="90%" border="0" cellspacing="0" cellpadding="2"&gt; &lt;tr id="AllText" runat="server"&gt; &lt;td class="media_ved_tit_aro" id="AllArrow" runat="server"&gt; &amp;nbsp; &lt;/td&gt; &lt;td class="media_txt_b " &gt; &lt;asp:Label ID="Label4" runat="server" Text='&lt;%#Eval(Globals.Translate("YoutubeTitle_EN", Page))%&gt;' /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; </code></pre> <p>cs:</p> <pre><code>protected void DataList2_ItemDataBound(object sender, DataListItemEventArgs e) { string LanguageID = Globals.GetSuitableLanguage(Page); if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ArrowAll = e.Item.FindControl("AllArrow") as HtmlGenericControl; TextAll = e.Item.FindControl("AllText") as HtmlGenericControl; } if (LanguageID == "ar") { ArrowAll.Attributes.Add("Class", "media_ved_tit_aro_AR"); TextAll.Attributes.Add("Class", "News_Image"); } } </code></pre>
c# asp.net
[0, 9]
24,418
24,419
Replace contents of a script block using jQuery
<p>I've a script block in HTML which basically has some JSON content. I would like to replace contents inside it using jQuery. I did something like this:</p> <pre><code>$("#data").html(newjson); </code></pre> <p>Above statement only works with Firefox. It does not work with IE? How do I make this work in IE.</p>
javascript jquery
[3, 5]
1,898,802
1,898,803
Extending Python with C++ no SWIG
<p>OK so I have a C++ function with a header like this:</p> <pre><code>int myfunc(vector&lt;int&gt; a, vector&lt;mystruct&gt; b, vector&lt;int&gt; c) </code></pre> <p>I have written the wrapper code (using Python.h as I have done many times with C, which translates the Python data types into the vector datatypes and structs I use in my program). The problem is I don't know how to tell setup.py to compile it with g++, I get a bunch of errors when I run</p> <pre><code>setup.py build -i </code></pre> <p>My setup.py:</p> <pre><code>from distutils.core import setup, Extension setup(name="MyModule", version="1.0", ext_modules=[Extension("MyModule", ["myfunc.cpp"])]) </code></pre> <p>Can anyone tell me how I can make the build process use g++ a not gcc</p>
c++ python
[6, 7]
2,417,806
2,417,807
auto calculate total value
<p>i have form as shown in picture</p> <p><img src="http://i.stack.imgur.com/kSYcR.jpg" alt="enter image description here"></p> <p>what i need is, when i type/ change value in amount, it auto calculate sum at the bottom</p> <p>also i don't want to let add any character...</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,101,337
1,101,338
Autocomplete from php source file requerying source page rather than call PHP Source file
<p>I am trying to use the JQuery Autocomplete with PHP source file, but when I check with FIREBUG I see on change of the Input field, the page is just requerying itself rather than call my source PHP file</p> <p>Code Segment</p> <pre><code>$().ready(function() { $("#item_name").autocomplete("./utilities.php?op=autocomplete", { width: 260, matchContains: true, //mustMatch: true, minChars: 2, //multiple: true, //highlight: false, //multipleSeparator: ",", selectFirst: false }); }); </code></pre> <p>PHP SOURCE FILE</p> <pre><code>if($op=='autocomplete'){ $dataset = array(); $item_name = $_REQUEST['item_name']; if (!$item_name) return; $sql = "select select concat(item_id,' - ',item_name) item from payment_items where item_name like '%$item_name%'"; //echo $sql; $result = mysql_query($sql); if($result){ for($i=0; $i&lt;$numrows; $i++){ $row = mysql_fetch_array($result); echo $row['item']; } } } </code></pre> <p>The utilities file is a UTILITY PAGE so the need to define an $op parameter to determine what I want to achieve.</p> <p>Thanks for the help</p>
php jquery
[2, 5]
1,172,383
1,172,384
Error when execute Response.End()
<p>I got a following error when<br> <code>Response.End();</code><br> is execute.<br><img src="http://i.stack.imgur.com/pifF2.png" alt="enter image description here"></p> <p>Its look like a <code>threading error</code> but unable to handle it.Any body know about the error and how to fix it?.I am using <code>VS2008</code>.Thanks.</p>
c# asp.net
[0, 9]
5,364,205
5,364,206
Sorting a data table based on sort order from another data table
<p>I have 2 data tables, one in which i have my data(D1) with a unique data Id and in another data table(D2) i have the Ids of all the records of my data table(D1) in a particular order.How can i sort my data table(D1) based on the order of Ids in D2.I am using c# asp.net </p>
c# asp.net
[0, 9]
1,833,037
1,833,038
How to read/parse article content from link to string
<p>I was in need of help. How do I get content on article websites with java or android?</p>
java android
[1, 4]
665,283
665,284
C# and ASP.Net. Guidance required
<p>I am a student and do my work and projects in c#.. I have not experienced WEB still. The question I wish to ask is that whenever in or near future if I wish to switch onto developing WEB Applications on ASP.Net, will I experience any difference ?? excluding any syntax changes.. I mean in C# the way do Add Update and Delete Records and the calculations, will I be experiencing the same in ASP.Net?? </p> <p>I don't have any concepts of WEB.I want to ask you people that what do you consider the most important to learn before switching onto ASP.Net?</p> <p>Guide me please.. :/</p>
c# asp.net
[0, 9]
4,475,684
4,475,685
PHP Variable in Echoing JavaScript
<p>I have an php script that is echoing JavaScript, in the JavaScript there are PHP variables </p> <pre><code>echo '&lt;script type="text/javascript"&gt; FB.init({ appId: "myid", channelUrl: "//mysite/channel.html", status: true, // check login status cookie: true, // enable cookies to allow the server to access the session xfbml: true // parse XFBML }); FB.getLoginStatus(function (response) { if (response.status === "connected") { FB.api("me/bookvote:download", "post", { book: "&lt;?php echo "http://mysite/auction_details.php?name=$item_details["name"]&amp;auction_id=$item_details["auction_id"]";?&gt;", fb:explicitly_shared = "true" //? Is syntactically valid but creates a global }, //Missing a , here? </code></pre> <p>However, I am still getting: </p> <pre><code>Uncaught SyntaxError: Unexpected identifier for book: http://mysite.xom/auction_details.php?name=$item_details["name"]&amp;auction_id=$item_details["auction_id"]";?&gt;", </code></pre> <p>What should I do?</p>
php javascript
[2, 3]
4,502,241
4,502,242
Getting the application roots
<p>I am trying to get the my application's physical and relative root programatically, but I am having some problems. I was easily able to get the physical path using <code>HttpContext.Current.Server.MapPath("~/")</code>, but the relative root is proving tricky.</p> <p>I tried the recommended solution of doing:</p> <pre><code>HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host </code></pre> <p>But this just gave me <code>htpp://localhost</code>, removing the last <code>.com/</code> part.</p> <p>My only solution was to access the full URL and try to get the domain by breaking down the string, but I am wondering if there is a better way to do it.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
1,308,732
1,308,733
Calling an ASP generated button click from a javascript
<p>I've following button on my web control,</p> <pre><code>&lt;asp:Button runat="server" ID="btnSave" Text="Save" onclick="btnSave_Click" OnClientClick="myShowWaitScreenWithNoClose('Processing...', 'Saving survey.Please wait it may take minutes..');" CssClass="buttons" Height="46px" Width="212px" Visible="false" /&gt; </code></pre> <p>and I'm trying to click this button using JavaScript from code behind. Like,</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ScriptManager.RegisterStartupScript(this, this.GetType(), "scr", "setTimeout(function(){document.getElementById('btnSave').click(); return false;}, 180000);", true); } } </code></pre> <p>But it throws an error <code>Error: TypeError: document.getElementById(...) is null</code></p>
c# javascript asp.net
[0, 3, 9]
2,192,059
2,192,060
setTimeout on Asynchronous function
<p>I have a asynchronous function that I want to have a 5000ms delay before being fired. I am trying to use <code>setTimeout()</code> to achieve this. This async function occurs in a loop that runs several times, with the async function being passed different data each time, thus <code>setInterval()</code> cannot be used here.</p> <p><strong>Problem:</strong> The async function gets triggered instantly without delay (console prints 5 <code>Done</code> messages instantly` and loops without any delay. What happened, and how can I solve it?</p> <p><strong>Javascript Code</strong></p> <pre><code>someFunction(listings, function() { for (var i in listings ) { var listing = listings[i]; setTimeout(asyncFunction(listing, function(data) { console.log('Done'); }), 5000); } }); </code></pre>
javascript jquery
[3, 5]
2,347,258
2,347,259
Rename the uploading Image
<p>i am uploading the image into the server , need to place the _ in place of gap in the image. Like if the name of image is Stack Flow.jpg, i need to send it as Stack_Flow.jpg in the directory as well in the email. HOw could be possible with the following code. i have tried but no success.. I am sending the 4 files in one form, code as --- </p> <pre><code>$filea = $_FILES['FILE1']['name']; $fileb = $_FILES['FILE2']['name']; $filec = $_FILES['FILE3']['name']; $filed = $_FILES['FILE4']['name']; $order_image_a='order_'.$orderId.'_'.$filea; if(!empty($filea)) move_uploaded_file($_FILES['FILE1']['tmp_name'], "../files/$order_image_a"); $order_image_b='order_'.$orderId.'_'.$fileb; if(!empty($fileb)) move_uploaded_file($_FILES['FILE2']['tmp_name'], "../files/$order_image_b"); $order_image_c='order_'.$orderId.'_'.$filec; if(!empty($filec)) move_uploaded_file($_FILES['FILE3']['tmp_name'], "../files/$order_image_c"); $order_image_d='order_'.$orderId.'_'.$filed; if(!empty($filed)) move_uploaded_file($_FILES['FILE4']['tmp_name'], "../files/$order_image_d"); </code></pre> <p>i am using below function, how could i apply it for all four files-- </p> <pre><code>&lt;script&gt; function convertSpecialChars($str) { $str = str_replace( " ", "_", $str ); return $str; } &lt;/script&gt; </code></pre>
php javascript
[2, 3]
5,061,105
5,061,106
Is there a way to ignore a mouse event?
<p>When I hover over a div (assume it has id=div-CON), I have another div, positioned absolute, that pops up and follows the mouse while I am within div-CON. When the mouse leaves div-CON, the floating div disappears.</p> <p>Now, there are instances where if the browser is slow or lagging, the floating div does not update its position quick enough such that the mouse enters the floating div for an instant then leaves it. In this instant, the mouse leaves div-CON and enters again so the floating div essentially blinks.</p> <p>With regards to this, I was wondering if there was a way to ignore or cancel events so that in this case, when the mouse enters the floating div, the mouseleave event is not triggered on div-CON.</p> <p>Heres a jsFiddle: <a href="http://jsfiddle.net/vuxcR/" rel="nofollow">http://jsfiddle.net/vuxcR/</a></p>
javascript jquery
[3, 5]
4,620,385
4,620,386
call js script on every change state
<p>i have big table with many html items such as select, textbox, radio-button, checkbox. also i have some function. i want to call this function on every change in item. for example select was changed, or some text type in textbox, or click radiobutton. how can i simply subscribes and call my js function? i can insert in any item </p> <blockquote> <p>onchange='function()'</p> </blockquote> <p>but may be jquery allow more simly way? any sample?</p>
javascript jquery
[3, 5]
3,271,916
3,271,917
using Jquery to show one error message at a time
<p>I'm trying to show one error message at a time and then once that error has been corrected to show the next error.</p> <p>For example there is validation on three textbox (Date, Month &amp; Year) once the date textbox is valid then the month error message choudl show.</p> <p>The code I have so far for this is: </p> <pre><code>var pi_ArrayValidationResult; var pi_EachValidator = function(delegate) { if (typeof (Page_Validators) !== undefined) { for (var i = 0; i &lt; Page_Validators.length; ++i) { delegate(Page_Validators[i]); } } }; var pi_CheckValidators = function() { var fields = {}; pi_EachValidator(function(val) { if (fields[val.controltovalidate] === undefined) { fields[val.controltovalidate] = true; } fields[val.controltovalidate] = fields[val.controltovalidate] &amp;&amp; val.isvalid; }); for (var field in fields) { if (fields.hasOwnProperty(field)) { $('#' + field) .parent('div.fm-req') .toggleClass('fm-error', !fields[field]); </code></pre> <p>This section is the bit that needs modification, to show one error then the next once the previous error is corrected:</p> <pre><code> $('#' + field).siblings('span').hide(); $('#' + field).siblings('span').each(function() { var $this = $(this); if (!$this.isvalid) { $this.show(); return false; } }); } } }; return { init: function(args) { var fnOld = ValidatorUpdateIsValid; ValidatorUpdateIsValid = function() { fnOld(); pi_CheckValidators(); } } }; </code></pre>
javascript jquery
[3, 5]
4,968,917
4,968,918
Php redirect to one server to another sever php page
<p>I have two server A and B and both server are same script but i want redirect page when i login to server A login page then the page is automatic redirect to server B login page is it possible?</p>
php javascript
[2, 3]
6,009,986
6,009,987
Response.WriteFile stopping previous request
<p>I have a button that calls a click event to download a picture. In my click event I have some code to change my display as the Save dialog pops up. The issue I am having is that when the dialog comes up it stops the previous line of code from executing. How can I check to see that my code has executed before calling the function?</p> <p>Here is my button event handler and function:</p> <pre><code> protected void btnSave_Click(object sender, EventArgs e) { var _title = txtTitle.Text; txtTitle.Text = string.Empty; txtDescription.Text = string.Empty; ChangeDisplay(); if (Request.Browser.Browser == "IE") lblSnapShot.Visible = (lblSnapShot.Visible) ? false : true; SaveSnapShot(_title); } void SaveSnapShot(string _title) { try { FileInfo _fileToDownload = new FileInfo(_path); Response.Clear(); Response.ContentType = "image/png"; Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + _title + ".png\""); Response.WriteFile(_fileToDownload.FullName); HttpContext.Current.ApplicationInstance.CompleteRequest(); } catch (System.Exception ex) { ChangeDisplay(); if (Request.Browser.Browser == "IE") lblSnapShot.Visible = (lblSnapShot.Visible) ? false : true; Response.Write("SAVE FAILED \n Error: " + ex.Message); } } </code></pre>
c# asp.net
[0, 9]
4,558,101
4,558,102
Whenever I am running my android app, it says "XYZ is not responding"
<p>It was running perfectly fine till yesterday... I am new to android programming , Any help would be great.. In my app I am parsing a downloaded xml file and then creating a dynamic UI... Here is a snippet of my code..</p> <pre><code>private class ParseXML extends AsyncTask&lt;Integer, Integer, Document&gt;{ public void onPostExecute(Document d) { ParseDocument(d); } @Override protected Document doInBackground(Integer... params) { // TODO Auto-generated method stub DocumentBuilderFactory dbf= DocumentBuilderFactory.newInstance(); try { //Uri uri = Uri.parse("android.resource://com.example.xml_parser/raw/options"); InputStream is=getResources().openRawResource(R.raw.options); DocumentBuilder db = dbf.newDocumentBuilder(); dom=db.parse(is); Log.i(TAG,"parsing done"); } catch(ParserConfigurationException pce){ pce.printStackTrace(); } catch(SAXException se){ se.printStackTrace(); } catch(IOException ioe){ ioe.printStackTrace(); } return dom; } </code></pre>
java android
[1, 4]
5,694,579
5,694,580
jQuery .hover(function{}) only on actual hover
<p>I'm familiar with jQuery but i have one little setback. I would like the function to be called only when i just hover the element, and not when im already hovering it and i slightly move the mouse.</p> <p>I simply want the function to be called only if i'm entering the area of the element from outside of it.</p> <p>I hope this makes sense.</p> <p>Any ideas?</p>
javascript jquery
[3, 5]
2,523,088
2,523,089
Choosing Object in For Loop based on Input
<p>I want to populate select options based on the value of the previously selected option.</p> <pre><code> &lt;label for="state" class="block"&gt;State:*&lt;/label&gt; &lt;select name="state" id="state" tabindex="1"&gt; &lt;option value="Arizona"&gt;Arizona&lt;/option&gt; &lt;option value="Arkansas"&gt;Arkansas&lt;/option&gt; &lt;option value="Colorado"&gt;Colorado&lt;/option&gt; &lt;/select&gt; &lt;label for="location" class="block"&gt;Preferred Location:*&lt;/label&gt; &lt;select name="location" id="location" tabindex="2"&gt; &lt;option value=""&gt;&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Thats my html. Right now I have my js, and it works, but I'm wondering if there is a petter way.</p> <pre><code> var State = $('#state').val(); var Location = $('#location'); setOptions(State); function setOptions(chosen){ var Location=document.myform.location; Location.options.length=0; var Arizona = { 0 : 'Select Location', 3 : 'Phoenix (Chandler)', 4 : 'Scottsdale', 5 : 'Tuscon' }; var Arkansas = { 2 : 'Little Rock' }; var Colorado = { 6 : 'Colorado Springs' }; if(chosen=="Arizona"){ var myobject = Arizona; } if(chosen=="Arkansas"){ var myobject = Arkansas; } if(chosen=="Colorado"){ var myobject = Colorado; } for(index in myobject) { Location.options[Location.options.length]=new Option(myobject[index], index); } </code></pre> <p>Is there a way I can tell it which object to use based on the other select box?</p> <p>Thanks! </p>
javascript jquery
[3, 5]
1,774,779
1,774,780
How can I put the index number as a value in a foreach?
<p>I have the following code:</p> <pre><code>foreach (var SubTopic in Model.SubTopic.Description) { &lt;option value="xxx"&gt;SubTopic&lt;/option&gt; } </code></pre> <p>I would like to find a way to insert the index number into xxx as value. 01 for the first, 02 for the second option line etc. </p> <p>Is there an easy way to do this?</p>
c# asp.net
[0, 9]
254,236
254,237
how to select drop down list based on <p> value
<p>Click form edit has trouble on drop down list</p> <p>Dropdown list shows first item. I need to select value based on <code>&lt;p&gt;Professor&lt;p/&gt;</code></p> <p>html</p> <pre><code>&lt;p&gt;Title&lt;/p&gt; &lt;p class='title'&gt;Professor&lt;/p&gt; </code></pre> <p>JQuery </p> <pre><code>$('.title').click(function(){ $(this).replaceWith('&lt;select class="title" name="title"&gt;&lt;option &gt;Please Select&lt;/option&gt;&lt;option value="Mr"&gt;Mr&lt;/option&gt;&lt;option value="Mrs"&gt;Mrs&lt;/option&gt;&lt;option value="Ms"&gt;Ms&lt;/option&gt;&lt;option value="Miss"&gt;Miss&lt;/option&gt;&lt;option value="Dr"&gt;Dr&lt;/option&gt;&lt;option value="Professor"&gt;Professor&lt;/option&gt;&lt;option value="Sir"&gt;Sir&lt;/option&gt;&lt;/select&gt;'); });​ </code></pre> <p><a href="http://jsfiddle.net/sweetmaanu/U7rAc/3/" rel="nofollow"><strong>Demo</strong></a></p>
javascript jquery
[3, 5]
4,302,170
4,302,171
How to draw a graph in asp.net 2.0
<p>I want to represent a Graphical analysis in a web application which is being developed in .net 2.0. I refereed some of the jquery plugin but did not find appropriate.</p> <p>I want to present a graph similar to reputation section of stack overflow if you've seen. Please help to find such a graph plugin.</p>
jquery asp.net
[5, 9]
531,653
531,654
How can I redirect based on a selection of a DropDownList
<p>I have a <code>TextBox1</code> and a Search button in my application with this following code:</p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("~\\searchpage.aspx?PatientNRIC=" + TextBox1.Text); } </code></pre> <p>Which means, if the user type ONLY <code>IC NO:S1234567D</code>, then when click it will show the patient detailview.</p> <p>So I now I'm doing almost the same thing but now I have a <code>TextBox2</code> and a <code>DropDownList1</code>. Inside <code>DropDownList1</code>, I have "Name", "IC No", "Test_Date".</p> <p>So for an example, I type "S1234567D" in the textbox1, and I choose "IC No" in <code>DropDownList1</code> it should redirect me to a page of the S1234567D's patient detailview.</p> <p>How could I do my code? Thanks!</p>
c# asp.net
[0, 9]
352,162
352,163
Post to Get method Conversion Vulnerability in ASP.net application
<p>How can an Asp.Net web application be prevented from accepting Post to Get method conversion. More precisely, how can 'GET' requests be rejected where a 'POST' data is expected. I will greatly appreciate clarification on how this VULNERABILITY occurs and how it can be prevented. Thanks.</p>
c# asp.net
[0, 9]
1,734,348
1,734,349
Web Application Authentication
<p>I have two questions concerning authentication of a intranet website and how to go about doing it.</p> <ol> <li>I want the first page the user comes to, to be the login page. I could have sworn there was a tag, something like [Authorize] that you put in your C# code that did this for you but I can't find it anymore. Right now the first page is my dafault.aspx. I turned on windows authentication in the web.config file and it automatically logged me in. So that is working, but I want the user to have to login as stated above. What do I have to do?</li> <li>I only want to allow people that are in a certain group to have access. How do I add this additional check?</li> </ol>
c# asp.net
[0, 9]
399,651
399,652
javascript detect browser close tab/close browser
<p>any cross browser javascript/jquery to detect if browser is closing tab or closed browser ? and should not activate event when go to other link? </p>
javascript jquery
[3, 5]
1,519,584
1,519,585
Javascript validation
<p>I have a form that people can click and add fields to the form and I need to have it validate the values in those fields if it is clicked. </p> <p>So say I click it twice and get the 2 separate sets of fields and I need the rotation % to make sure it equals 100 at the time of save. </p> <p>I have put in this function to get it to validate on the save and everything works except if I edit a different form that doesnt have any fields in it.<br> I am trying to see what the easiest way would be to check and see if the fields are on there or not so I can check them.</p> <p>Here is my code:</p> <pre><code>function audit() { var totalsum = 100; $( '[name="rotation\\[\\]"]').each( function() { totalsum -= ($(this).val() * 1); } ) if(totalsum &gt; 0){ alert("Your rotation % does not equal 100"); return false;} return true;} </code></pre> <hr> <pre><code>$('.add_creative img').click( function(){ $.post( '/json/ad_creative/', { action: "add_creative", this_brand_id: $("[name='this_brand_id']").val(), adtype: $( '.new_run [name="adtype"]').val()}, function(data){ if( data.result ){ $('.add_creative').append(data.html) } }, 'json' ) </code></pre>
javascript jquery
[3, 5]
4,886,523
4,886,524
ASP.NET: Insert Multiple Values from a Dropdownlist into Database
<p>How can I insert two different values into columns of a table in a database when both values come from the same DropDownList? For example one value is 'name' and the other is 'id'. </p>
c# asp.net
[0, 9]
4,031,774
4,031,775
Setting focus on top of the page on click of asp.net link button
<p>I've a asp.net datagrid which shows customer order details. Pagination at the bottom of the grid is done using datalist and asp.net Linkbutton controls. Here is the code:</p> <pre><code> &lt;asp:DataList ID="DataList2" runat="server" CellPadding="1" CellSpacing="1" OnItemCommand="DataList2_ItemCommand" OnItemDataBound="DataList2_ItemDataBound" RepeatDirection="Horizontal"&gt; &lt;ItemTemplate&gt; &lt;asp:LinkButton ID="lnkbtnPaging" runat="server" CommandArgument='&lt;%# Eval("PageIndex") %&gt;' CommandName="lnkbtnPaging" Text='&lt;%# Eval("PageText") %&gt;'&gt;&lt;/asp:LinkButton&gt; &lt;asp:Label runat="server" ID="lblPageSeparator" Text=" | " name=&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; </code></pre> <p>When the user clicks on any page number(ie.Link button), I need to set focus on top of the page. How do i do this?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
4,154,980
4,154,981
jQuery: Timeout after trigger()
<p>I using a mesh of organic tabs and a image rotator. When the user clicks on one of the thumbnails, the image rotator stops auto-advancing. When the user clicks on a tab, the auto-advance starts again. However, without a timeout or pause, the auto-advance may change simultaniously when the user clicks on a tab.</p> <p>jQuery Code:</p> <pre><code>current=-1; $('.years li:first a', tab).trigger('click',[true]); current=1; </code></pre> <p>Current is used as a flag. When it's -1, the auto-advance function will return false. How do I add a delay before setting current to 1? I was thinking something like:</p> <pre><code>$('.years li:first a', tab).trigger('click',[true]).setTimeout(function(){current=1},1000); </code></pre> <p>But this obviously doesn't work.</p>
javascript jquery
[3, 5]
3,285,709
3,285,710
jQuery get the id from the parent selector?
<p>I have the following code and this is getting the id attribute of the 'a' element. However, I'd like to get the id attribute of the original '.panel' class.</p> <p>Any ideas how to do this? Thank you!</p> <p>jQuery:</p> <pre><code>$('.panel .panel_content a').click(function(){ alert($(this).attr('id')); }); </code></pre> <p>Markup:</p> <pre><code>&lt;div class="panel" id="step_2"&gt; &lt;h3&gt;Title&lt;/h3&gt; &lt;div class="panel_content"&gt; &lt;a href="#"&gt;Item&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,227,427
3,227,428
string indexer works localy but not when site is hosted
<p>I have following problem with java script.</p> <p>I have <em>jQuery</em> object. Locally getting i-th symbol of its value i use following code $(this).val()[i];</p> <p>When i deployed this code in server this line started throwing exception saying that $(this).val()[i] is undefined and instead of it i used $(this).val().charAt(i) function; charAt() function works fine both in server and local.</p> <p>I can't understand how this kind of issue could happen as the same script is being executed in same browser.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
3,741,719
3,741,720
JavaScript variable value to a PHP
<p>I know that the following question has been asked many times:</p> <pre><code>&lt;script&gt; var myVar = 123; &lt;?php $what_is_myVar = myVar ; ?&gt; &lt;/script&gt; </code></pre> <p>My searching results for this question were: </p> <ul> <li>PHP runs on the server, JavaScript runs on the client…</li> <li>Need to use Ajax to pass a JS value...</li> <li>This code will never work you…</li> <li>Need to set hidden field value…</li> <li>Use $_GET[]…</li> </ul> <p>I tried the following, but that didn’t work:</p> <pre><code>&lt;?php $what_is_myVar = "&lt;script&gt;document.write(myVar)&lt;/script&gt;"; ?&gt; </code></pre> <p>I couldn’t find anywhere a complete short solution in order to pass the value of <code>myVar</code> into <code>$what_is_myVar</code></p> <p>Please can anyone help me on this issue,</p>
php javascript
[2, 3]
2,113,739
2,113,740
echo javacript form value
<p>I have this script.</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript" src="sha1.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;?php $A= 'TEST01'; $B= '059B8125F'; $C= '20061123_003'; $D= '100.00'; $E= '50126'; ?&gt; &lt;form name="checkout" method="post" action=""&gt; &lt;input type="hidden" name="A" value="&lt;?php echo $A; ?&gt;" /&gt; &lt;input type="hidden" name="B" value="&lt;?php echo $B; ?&gt;" /&gt; &lt;input type="hidden" name="C" value="&lt;?php echo $C; ?&gt;" /&gt; &lt;input type="hidden" name="D" value="&lt;?php echo $D; ?&gt;" /&gt; &lt;input type="hidden" name="E" value="&lt;?php echo $E; ?&gt;" /&gt; &lt;/form&gt; &lt;script type="text/javascript" language="javascript"&gt; var str = "##" + form.A.value.toUpperCase() + "##" + form.B.value.toUpperCase() + "##" + form.C.value.toUpperCase() + "##" + form.D.value.toUpperCase() + "##" + form.E.value.toUpperCase() + "##"; form.SIGNATURE.value = hex_sha1(str); &lt;/script&gt; &lt;/body&gt; </code></pre> <p>My question is, how to show the SIGNATURE value ini PHP? I want to show it in echo. Is it possible?</p> <p>Thank you all</p>
php javascript
[2, 3]
3,335,924
3,335,925
jquery & php: saving some data without reload
<p>I have three buttons and need to save some data. I have a idea, I have to set an ID to every button and then let the JS determinate witch button that has been pressed, like:</p> <pre><code>$("#mySpecifikButton").click(function() { ....some code here... }); </code></pre> <p>but then Im stuck. For example I have 9 users. All they have an ID in the db. So now we have all the users in separate rows:</p> <pre><code>&lt;p&gt;&lt;a id="userID"&gt;user 0&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a id="userID"&gt;user 1&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a id="userID"&gt;user 2&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a id="userID"&gt;user 3&lt;/a&gt;&lt;/p&gt; ... </code></pre> <p>When I press on a specifik user I want to add it to db through php with help of jquery. But how do I sent it to php with JS (jquery)?</p> <p>Im I thinking right or is there better ways?</p> <p>If I didn't described it well, ask me.</p>
php jquery
[2, 5]
3,188,610
3,188,611
Asp net grid view select row using jquery
<p>I have a normal gridview on asp.net web page... I want to select a row using jquery and then pressing a button to send the id and descripcion columns to a web service...</p> <p>My question is how can I select the row and get the information I want... all using jquery.</p>
jquery asp.net
[5, 9]
1,120,851
1,120,852
How to format a dollar?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript">How can I format numbers as money in JavaScript?</a> </p> </blockquote> <p>I am doing a divide and multiply to figure out the value of a field and the value looks like this</p> <pre><code>$32560.000000000004.00 </code></pre> <p>I am setting the value like this</p> <pre><code>sq_footage = $("#sq_footage").val(); sq_footage_total = (((sq_footage / 36) * factor) * average )* 30; if(factor != ""){ $("#new_calc").val("$" + sq_footage_total + ".00"); } </code></pre> <p>Is there a way to format it like </p> <pre><code>$32,560.00 </code></pre>
javascript jquery
[3, 5]
1,750,384
1,750,385
Help with ternary operator
<p>I don't think I am using the ternary operator correctly as I am not getting the results am I after:</p> <pre><code>buildHTML.push("&lt;a href='http://mysite/user?screen_name=" + data.friend == null ? data.user.me : data.friend + "'&gt;" + data.friend == null ? data.user.me : data.friend + "&lt;/a&gt;"); </code></pre> <p>This gives me <code>null</code> if <code>friend</code> is <code>null</code>, and gives me <code>friend</code> if <code>friend</code> is <code>not null</code></p> <p>It should be giving me <code>me</code> if <code>friend</code> is <code>null</code> and <code>friend</code> if <code>friend</code> is <code>not null</code>.</p> <p>What am I doing wrong?</p>
javascript jquery
[3, 5]
2,905,161
2,905,162
How to add a field validator and set it programmatically
<p>I need to add a field validator, the admin of the website sets the number of characters of a textbox in admin and then... in the front side users can only type upto the number of characters specified by the admin.</p> <p>In the fron end i aleady pull the number from the database but now i am not sure how to create a validator where i can set the value say:</p> <pre><code>pseudocode Get the validator set the validator to validate these maximum number of characters myValidator.setamaxnumber = mydbvalue; error message = Only + mydbvalue + charaters are accepted. </code></pre> <p>I hope you understand what i want to do. If not, no need to do a negative vote post your question and i will try my best to supply more information</p> <p>Thanks a million</p>
c# asp.net
[0, 9]
2,001,342
2,001,343
What is the equivalent of the C++ Pair<L,R> in Java?
<p>Is there a good reason why there is no Pair in Java? What would be the equivalent of this C++ construct? I would rather avoid reimplementing my own.</p> <p>It seems that 1.6 is providing something similar (AbstractMap.SimpleEntry), but this looks quite convoluted.</p>
java c++
[1, 6]
1,093,278
1,093,279
How to properly make a Ken Burns effect using JQuery
<p>I recently tried the Ken Burns effect with this little jQuery plugin: <a href="http://tobia.github.com/CrossSlide/" rel="nofollow">CrossSlide</a>.</p> <p>The problem with that plugin is that when the motion is too slow it looks really bad. This is due to the fact that the image can only move 1 pixel at the time...</p> <p>I tried to do my own slideshow and I have the exact same problem. I then thought that this is normal... since we can only move an image pixel by pixel. </p> <p>But I just found this slider: <a href="http://codecanyon.net/item/estro-jquery-ken-burns-swipe-effect-slider/full_screen_preview/235111" rel="nofollow">Estro</a> Estro looks perfect to me. I wonder why it looks so smooth and how can I make mine look that good.</p> <p>How can my Ken Burns effect be as good as Estro's one.</p>
javascript jquery
[3, 5]
612,375
612,376
how to set Assembly version to the web application?
<p>i have developed the application in ASP.NET with C#. i want to set the Assembly version to this project but in property page this option can not be displayed .how to set Assembly version to the web application ? </p>
c# asp.net
[0, 9]
4,762,496
4,762,497
jquery - make a div appear where I click?
<p>Hey, I'm trying to make a little feature where I can click on an icon, and a box will appear that is similar to lightbox, but anchored on the icon. Is there a way to </p> <ol> <li>Tell where the icon is on the screen, and then </li> <li>Have the top left corner of my box placed where the icon is, and then </li> <li>Have my box appear in that location?</li> </ol> <p>Thanks!</p>
javascript jquery
[3, 5]
2,130,429
2,130,430
Need to view the thumbnail of the word Document
<p>If i browse the word file through file upload control in html, i want to view the thumbnail of the document(first page is enough) as an image in the right to my control..How to do it programmatically..please suggest..Thanks in advance...</p>
java javascript
[1, 3]
5,400,419
5,400,420
Jquery handle global variable
<p>I am having problem with the following code :</p> <pre><code>var pageviews = [ [1, 0] ]; $.get("http://bla..bla", function(res){ pageviews.push([2, res.value]); }, "json"); </code></pre> <p>I've checked the pageviews variable but the array is not updated. I can see the "res.value" on my console. So what is the problem?</p>
javascript jquery
[3, 5]
669,823
669,824
Where can I find a Java to C# converter?
<p>I needed to convert a Java 1.5se app to C# 2.0.</p> <p>Does anyone know of a tool (preferably free/open source) to do this?</p>
c# java
[0, 1]