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
781,309
781,310
ASP.NET MVC displaying user Data such as comments?
<p>hows the best way to display comments/user data from a db using mvc?</p> <p>do we just do our own for loop and manually display it or? will doing it this way cause paging problems in the future? any best methods or practice? </p> <p>jquery?</p> <p>thanks guys.</p>
asp.net javascript jquery
[9, 3, 5]
2,868,087
2,868,088
Moving from C# to C++ (Plus working with both in same solution)
<p>This is a very general question. I'm a self taught 'programmer' who programs in C#. A project I would like to work on would be made a whole lot easier (in the grand scheme of things) if I knew C++. How easy is it to move from C# to C++? Any pitfalls I should watch out for? And if I am using VS2010, can I program (not in the same class, but same project) something in both C# and C++? </p> <p>Thanks a lot!</p>
c# c++
[0, 6]
505,572
505,573
"Unable to download. Content not supported" when forcing download on Android device
<p>I'm writing a website which give a APK download automatically when someone accesses the link "http://www.sample-link.com/download/downloadApp This is my code on PHP site.</p> <pre><code> $fileName = "./uploads/MyAPK.apk"; header('Content-type: application/download'); header('Content-Disposition: attachment; fileName="' . basename($fileName) . '"'); header('Content-Transfer-Encoding: binary'); readfile($fileName); </code></pre> <p><strong>When I visit that link on PC, it works. When I do it on Android devices, the download can't be done. It's stuck in the download queue with error "Unable to download. Content not supported"</strong>. I tried to restart the device but it doesn't work. How to fix?</p>
php android
[2, 4]
307,505
307,506
Unescaping / decoding a string with a + in it
<p>I have some html that is output by PHP's urlencode - basically it's a simple bunch of anchors that look like this:</p> <pre><code>&lt;a href="#i+have+some+spaces"&gt;link1&lt;/a&gt; </code></pre> <p>I'm using jquery to take a look at all these references when they're clicked, however, I can't seem to decode it using any of the browser's internal functions. Do I have to replace +'s by myself?</p> <pre><code>unescape('Video+Games'); // returns Video+Games decodeURI('Video+Games'); // returns Video+Games decodeURIComponent('Video+Games'); // returns Video+Games </code></pre>
javascript jquery
[3, 5]
2,540,532
2,540,533
Label's text appeared nothing when is session over from the first page
<p>I am trying to Session over my Label.Text in the first .aspx page to another Label in the second .aspx page. I retrieve my value from the database and place them in the first Label.Text and want to Session this Label (Which i got the text from the database) to another page linked to the first page. I use this method is because i have a detailed products page (My first .aspx page) which consists of many products and when user click a particular product, it's product name have to be displayed in the second page of the .aspx . My problem here is that when i Session over the Label's text on the first page, the value does not pass over to another page. </p> <p>My first page's .cs code (code behind):</p> <pre><code>Session["productName"] = productName.Text; Response.Redirect("products2.aspx"); </code></pre> <p>My second page's .cs code (code behind - I place this code in page load)</p> <pre><code>if (Session["productName"] != null) productName.Text = Session["productName"].ToString(); </code></pre> <p>Have i gone wrong anywhere?</p>
c# asp.net
[0, 9]
2,088,469
2,088,470
How to read/write file on client side in ASP.NET
<p>How to read file form local file system(client side) in asp.net , is there any activeX require to do this or it can be done with out it</p>
c# asp.net
[0, 9]
3,564,948
3,564,949
Checking if an e-mail had already been added to a database
<p>I am editing an ASP form that is basically a newsletter subscription form. The issue is that I have no way of triggering an event alerting me if a user has already registered.</p> <p>I want to find a way to make the form check if that user's e-mail address exists within my database. If so, then just say, "You have already registered. Did you not receive a thank you email? Click here to receive the email again."</p> <p>As it stands, the user can register and they automatically get the Thank you form, but are not necessarily told whether they've already registered or not.</p> <p>EDIT: Sorry for not mentioning this earlier, but this database is managed using Microsoft's SQL Server. Yes, I am storing values using this method. Please let me know if I can include any more details -- I'm not very familiar with DBs.</p>
c# asp.net
[0, 9]
2,596,544
2,596,545
iPhone-like Sliding Headers
<p>I'm working on a project where per design we should have iPhone-like sliding headers in a table. There's a table which has rows with dates. The idea is to fix that date header and change it's text when the next such header is reached. To be more clear, I've found an example of such an implementation:</p> <p><a href="http://jqueryfordesigners.com/iphone-like-sliding-headers/" rel="nofollow">http://jqueryfordesigners.com/iphone-like-sliding-headers/</a></p> <p>The problem is that I can't use that technique as in that examples the list is wrapped in a container while in my case the container is the whole page (I'll need to handle the window scroll event instead of the container scroll) and I need to work with a table and table rows. Could anybody help me with an idea on how can this be done?</p> <p>UPDATE: The code of the table is pretty straightforward:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td colspan="3" class="daterow"&gt;08.25.2012&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Some other row&lt;/td&gt; &lt;td&gt;Some other row&lt;/td&gt; &lt;td&gt;Some other row&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3" class="daterow"&gt;08.24.2012&lt;/td&gt; &lt;/tr&gt; &lt;td&gt;Some other row&lt;/td&gt; &lt;td&gt;Some other row&lt;/td&gt; &lt;td&gt;Some other row&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
4,458,707
4,458,708
MAX_VALUE of a variable in php
<p>I come to java and I remember in JAVA there is a field MAX_VALUE that set an attribute to the MAX_VALUE. Now I would know if does it exist something like that in php with float variable</p>
java php
[1, 2]
5,207,673
5,207,674
How to include different Javascript files depending on build configuration?
<p>Is there a way to include a different Javascript file in an ASP.NET page depending whether it's a debug or release build? </p> <p>For release builds, I want to include the minified (using yuicompressor) Javascript, but I would like to use the more readable file for debug and development.</p>
asp.net javascript
[9, 3]
5,328,267
5,328,268
how can I execute a javascript program 30 after page loads
<p>how can I execute a javascript program 30 after page loads, and I have to execute it repeatedly in 30 seconds. I would like to use jquery since I already included in my document</p> <p>Thank you guys </p>
javascript jquery
[3, 5]
3,568,998
3,568,999
JavaScript getMonth() returns 50 for the month value
<p>Good morning gang.</p> <p>I have a jQuery Datepicker object that is prepoulated using a javscript Date object, and I have getMonth() returning 50 as the month, instead of 5. This was previously working as recent as 4/27/2012.</p> <p>Here's the code:</p> <pre><code>$(document).ready(function(){ $('#datepicker1').attr('readonly', 'readonly'); var press_date = new Date(); //This is the Date object that you're getting from external source $('#datepicker1').val(press_date.getFullYear()+'-' +press_date.getMonth()+1+'-' +press_date.getDate()); $('#datepicker1').datepicker({ showAnim:'slide',showOn: 'button', dateFormat : 'yy-mm-dd', buttonImage: 'images/calendar.jpg', buttonImageOnly: true,onSelect: function(dateText, inst) {} }); $('#datepicker').attr('readonly', 'readonly'); $('#datepicker').datepicker({ showAnim:'slide',showOn: 'button', dateFormat : 'yy-mm-dd', buttonImage: 'images/calendar.jpg', buttonImageOnly: true,onSelect: function(dateText, inst) {} }); }); </code></pre> <p>My guess is that this is a simple issue to resolve, but I haven't seen anything around the web to explain it.</p>
javascript jquery
[3, 5]
3,335,258
3,335,259
good jquery content separators
<p>just wondering if anyone knows of any pre built content switchers powered by jquery like the one depicted below (only have a screenshot, otherwise I wouldn't be asking :P):</p> <p><img src="http://i.stack.imgur.com/bALm6.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
3,658,402
3,658,403
Page_Load question
<p>I have this javascript modal which I want to use for error reporting. Everything works well only that the code gets executed before page load. So the result is that I have my javascript before the head tag which means nothing gets executed!</p> <p>Any help?</p> <pre><code>public void showError(string error) { string script = "&lt;script type=\"text/javascript\"&gt;$.facebox.settings.opacity = 0.4;jQuery.facebox(\""+error+"\");&lt;/script&gt;"; System.Web.HttpContext.Current.Response.Write(script); } </code></pre> <p>By the way, my ShowError method is within a class called ErrorDisplay This is how I call it:</p> <pre><code>string strErr = "error here"; ErrorDisplay myError = new ErrorDisplay(); myError.ShowError(strErr); </code></pre>
c# asp.net
[0, 9]
3,191,648
3,191,649
File Upload Control with a progress indiactor
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/5389585/asp-net-file-upload-progress-bar">ASP.NET file upload progress bar</a><br> <a href="http://stackoverflow.com/questions/49564/how-to-implement-file-upload-progress-bar-on-web">How to implement file upload progress bar on web?</a> </p> </blockquote> <p>Hi .,</p> <p>I am having a file upload control in a update panel. I need a progress indicator / progress bar . I have googled some material but can someone let me know / send me any good stuff if you have please.</p> <p>Thanks</p>
c# asp.net
[0, 9]
619,761
619,762
Javascript reverse order within dividers
<p>I have code like:</p> <pre><code>&lt;div class="a"&gt;Main&lt;/div&gt; &lt;div class="b"&gt;1&lt;/div&gt; &lt;div class="b"&gt;2&lt;/div&gt; &lt;div class="b"&gt;3&lt;/div&gt; &lt;div class="a"&gt;Another&lt;/div&gt; &lt;div class="b"&gt;4&lt;/div&gt; &lt;div class="b"&gt;5&lt;/div&gt; </code></pre> <p>And I want the output to be:</p> <pre><code>&lt;div class="a"&gt;Main&lt;/div&gt; &lt;div class="b"&gt;3&lt;/div&gt; &lt;div class="b"&gt;2&lt;/div&gt; &lt;div class="b"&gt;1&lt;/div&gt; &lt;div class="a"&gt;Another&lt;/div&gt; &lt;div class="b"&gt;5&lt;/div&gt; &lt;div class="b"&gt;4&lt;/div&gt; </code></pre> <p>Am trying to use the following but it does not work correctly:</p> <pre><code>$.fn.reverseOrder = function() { return this.each(function() { $(this).prependTo( $(this).parent() ); }); }; $('.b').reverseOrder(); </code></pre> <p>Because it reverses all the b divs to the top. Am a little lost. Any idea how to achieve this?</p> <p>I do not wish to modify the code to add more divs inside it to contain them as it breaks other code of mine (not provided here).</p> <p>I think I have to use nextAll and nextUntil functions. </p>
javascript jquery
[3, 5]
1,940,278
1,940,279
except jquery lazy load, how to add a `loading.gif` when php images are loading?
<p>I do not want to use jquery lazyload. because I want loading done all the pictures then show at the same time, not loading one by one.</p> <p>I know some thing like this, but how to make a judge when all the images are loaded, then remove the <code>loading.gif</code>? thanks.</p> <pre><code>$("div#content").prepend("&lt;img src='../loading.gif' class='ldrgif' / &gt;");//add a image ...//loading images in div#content $(this).find("img.ldrgif").remove(); //remove it, how to make a judge all the images are loaded? </code></pre>
php jquery
[2, 5]
488,600
488,601
does redirecting from grid using javascript increase performance
<p>does redirecting from grid using javascript increase performance in asp.net</p>
asp.net javascript
[9, 3]
1,685,807
1,685,808
Implementing AutoCad viewer in web project
<p>I need to implement an AutoCad viewer in my web project which will help the clients view AutoCad file without the need to install it in their PC.</p>
php jquery
[2, 5]
5,496,712
5,496,713
Looking for Redirection ASP.NET User authentication and alternative to Create new user wizard
<p>I have been having fun with ASP.NET until I arrived at the User Authentication in my journey. It's like I have hit a brick-wall. </p> <p>I am not trying to re-invent the wheel, I can't even if I tried, so I decided to simply use the forms authentication and an SQL Server Database to store user password. I can use a GUID and HASH using SHA256 or SHA512, or even salting before data insertion.</p> <p>However when I tried using this code I got an error that it was obsolete: <em>This is just for demonstrating my use of forms authentication not a real project:</em></p> <p><strong>Code:</strong></p> <pre><code>if (FormsAuthentication.Authenticate(txtUserName.Text, txtPassword.Text) &amp; (txtUserName.Text.Trim().Length &gt; 1) &amp; (txtPassword.Text.Trim().Length &gt; 1)) { ltrStatusMsg.Text = Database.InsertData(txtUserName.Text, txtPassword.Text); FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, chkMemory.Checked); } else { ltrStatusMsg.Text = "InValid Login"; } </code></pre> <p>My question is should I simply abandoned this idea of doing my own authentication; or is there no harm using the above method? Or use the Wizard?</p> <p>If Having Visual Studio Create the DB and using the Wizard is the most effective way, then I have no choice. I am simply doing a very basic web app nothing with Data about the next Alien Flight. :)</p> <p>Please advise:</p> <p>Thank you!</p>
c# asp.net
[0, 9]
797,120
797,121
Time of Timepicker get's lost on screen rotate
<p>I have an activity with following code.</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // set time picker values TimePicker picker = (TimePicker) findViewById(R.id.startTimePicker); picker.setIs24HourView(true); picker.setCurrentHour(10); picker.setCurrentMinute(15); } </code></pre> <p>So a time picker is set to a fixed time, this works as expected. But when I rotate the screen and the activity get's recreated the time picker show in all fields the same value - not the value set. This happens on one, two or more time pickers on screen.</p> <p>Has anybody an explanation for this weird behaviour?</p>
java android
[1, 4]
4,308,915
4,308,916
jQuery: How to append something after one element?
<p>DOM</p> <pre><code>&lt;div id="a"&gt; &lt;div id="b"&gt;&lt;/div&gt; &lt;div&gt; &lt;p&gt;Insert me after #b&lt;/p&gt; </code></pre> <p>Requirement is insert p tag after '#b', and when the insert operation happened again, only replace the p tag instead of adding more. </p> <p>Thanks for your help</p>
javascript jquery
[3, 5]
3,029,474
3,029,475
How to Detect the 'Done' keyboard action on Android via Javascript
<p>I have a mobile web app, where I have an HTML5 Input field (type=number). On the Default Galaxy S3 browser, the 'Done' button on the keyboard does not fire the 'blur' event on that field. (This works fine on the Iphone) . I need to know how to trap the 'done' event on an Android . Anyone know how to achieve this ?</p> <p>Thanks in advance.</p>
javascript android
[3, 4]
4,529,572
4,529,573
how to display table formatted data in java script popup
<p>Hi how to display table formatted data in java script popup. it is possible to display table formatted data in java script popup. in asp.net using C# language. </p>
c# javascript asp.net
[0, 3, 9]
3,608,372
3,608,373
Android: How to schedule a Background Service to run repeatedly
<p>I have a AsyncTask in a Service which gets RSS feeds and stores them in the SQLiteDatabase. The service is started from the main Activity. I need the AsyncTask to be executed say after every 4 hours or so to pull the RSS feeds. I tried using the TimerTask as below but this does not seem to be working. The background task is run just once. Any ideas on how to best implement this scenario/any alternatives?</p> <pre><code>public class FeedReader extends Service{ private void getFeedsRegularly() { timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { handler.post(new Runnable() { @Override public void run() { new BgTask().execute(feedURL); } }); } }, 0, UPDATE_INTERVAL); } private class BgTask extends AsyncTask&lt;...&gt; {...} } </code></pre>
java android
[1, 4]
4,808,547
4,808,548
highlight specific divs (tds) onhover of a link
<p>So i'm just starting to discover how awesome jquery is and how a basic function can drive me nuts to understand. I'm trying to highlight a div with a specific "id" generated via backend</p> <pre><code> &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt; &lt;div id="id_1"&gt; &lt;h2&gt;id_1 - &lt;a class="marker_id_1" href="#top" name="id_1" id="id_1"&gt;Top&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt; &lt;div id="id_1"&gt; &lt;h2&gt;id_1 - &lt;a class="marker_id_1" href="#top" name="id_1" id="id_1"&gt;Bottom&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt; &lt;div id="id_2"&gt; &lt;h2&gt;id_2 - &lt;a class="marker_id_2" href="#top" name="id_2" id="id_2"&gt;Top&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt; &lt;div id="id_2"&gt; &lt;h2&gt;id_2 - &lt;a class="marker_id_2" href="#top" name="id_2" id="id_2"&gt;Bottom&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt;​ </code></pre> <p>So if I hover over the "id_1" Top , I want to highlight both the "id_1" Top and Bottom. Below is a link to that so it'll be easier to understand.</p> <p><a href="http://jsfiddle.net/4PgC6/66/">http://jsfiddle.net/4PgC6/66/</a></p> <p>Thanks!!</p>
javascript jquery
[3, 5]
2,092,585
2,092,586
Error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
<p>I am getting the error below when I destroy and create datatable</p> <pre><code>RadioButton rdb2 = new RadioButton(); RadioButton rdb3 = new RadioButton(); rdb1 = (RadioButton)DataList1.Items[item.Id].FindControl("One"); rdb2 = (RadioButton)DataList1.Items[item.Id].FindControl("Three"); rdb3 = (RadioButton)DataList1.Items[item.Id].FindControl("Seven"); </code></pre> <p>What I am doing is based on the user selection I am calling the data from database and put it into a new data table which I use as DataScouce for my DataList.</p> <p>Please help me how to solve this error. I have seen the <a href="http://support.microsoft.com/kb/836874" rel="nofollow">link</a> also for solution but it didn't help.</p>
c# asp.net
[0, 9]
2,434,042
2,434,043
modifying global javascript variables and accessing them in the HTML
<p>I'm very new to fiddling with javascript - but here is what I'm trying to accomplish.</p> <p>I have code like such:</p> <pre><code> $('#numberItems').keyup(function () { var num = parseInt($(this).val()); var price = parseInt($('#price').text()); var.cost = num * price $('#total').text(cost); }).keyup(); </code></pre> <p>This really works fine for what I'm doing - but what I'd like to do is take the cost variable and stick it in a link - such as:</p> <pre><code>&lt;a href="http://www.google.com/&lt;script&gt;document.write(cost)&lt;/script&gt;"&gt;Googly&lt;/a&gt; </code></pre> <p>I realize, to make the variable global, I need to stick outside of the function, but then how do my calculations save to it?</p>
javascript jquery
[3, 5]
4,535,251
4,535,252
jquery preventing selectedindexchanged event on dropdown?
<p>I have a dropdown, on which i created jquery for multi-select. When i add autopostback=true and selectedindexchanged event, dropdown doesn't fire.</p> <p>Please suggest me how to get the selectedindexchanged event fired if i am using jquery?</p>
jquery asp.net
[5, 9]
1,357,966
1,357,967
Show/Hide Multiple Divs
<p>I am trying to trigger a show/hide of one div at a time.</p> <p>What is happening is that all the divs (.shareLink) are opening at the same time.</p> <p>Below is my jqury:</p> <pre><code>$(document).ready(function(){ $(".shareLink").hide(); $("a.trigger").click(function(){ $(".shareLink").toggle("400"); return false; }); }); </code></pre> <p>Below is my HTML:</p> <pre><code>&lt;dl class="links"&gt; &lt;dd&gt;content&lt;/dd&gt; &lt;dt class="description"&gt;content&lt;/dt&gt; &lt;ul class="tools"&gt; &lt;li&gt;&lt;a class="trigger" href="#"&gt;Share Link&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/dl&gt; &lt;div class="shareLink"&gt; &lt;?php print check_plain($node-&gt;title) ?&gt; &lt;/div&gt; </code></pre> <p>Any help with the above problem would be much appreciated.</p> <p>Cheers.</p>
javascript jquery
[3, 5]
3,537,677
3,537,678
How to reload/rfresh a div on page load?
<p>I have a div block i want it to be automatically referrshed once or twice during when page is loading .</p> <p>How can refresh/reload the div once or twice using jquery or javascript?</p>
javascript jquery
[3, 5]
873,171
873,172
Call wait() from a Class on other Thread
<p>I want to call <code>wait()</code> on other Thread becoz if my current class some part of code is executing don't want to interrupt by other thread.. for this i m doing like this</p> <p>main.class</p> <pre><code>testThread as=new testThread(); try{ synchronized(as) { wait(); } } catch (Exception e) { Log.d(tag, "In ==Scheduler== error"+e.toString()); } </code></pre> <p>testThread.class</p> <pre><code>public void run() { while(true) { System.out.println("Thread"); try { Thread.sleep(6000); } catch(Exception r) { } } } </code></pre> <p>And getting the following error</p> <blockquote> <p>error java.lang.IllegalMonitorStateException: object not locked by thread before wait()</p> </blockquote> <p>Why am I getting this error, and how can I fix it?</p>
java android
[1, 4]
3,658,106
3,658,107
Is it possible to progressively enhance image quality while zooming in safari mobile
<p>Is there any JavaScript/jQuery plugin that can take large images and enhance the quality while zooming? something like google earth/maps?<br></p> <p>I want to use it in mobile browser, but a desktop solution will do too</p>
javascript jquery iphone
[3, 5, 8]
4,752,199
4,752,200
lock all submit button before page fully rendered
<p>may i know how to use jquery to lock all the <code>&lt;input type="submit/button" ..</code> and only allow submit when page is fully rendered?</p>
javascript jquery
[3, 5]
2,166,720
2,166,721
C# method gives me an error
<p>I have created one method in c# that has two parameters. I have just changed its parameter name but now it is giving me old parameters value. And the error is coming while runtime.</p> <p>This is new method which i have changed its parameter</p> <pre><code>public void UpdatePagedDataSet(string configKey, string configValue) { ---SOME CODE--- } </code></pre> <p>This is old method works fine</p> <pre><code>public void UpdatePagedDataSet(string CONFIGKEY, string CONFIGVALUE) { ---SOME CODE--- } </code></pre> <p>Error:</p> <pre><code>could not find a non-generic method 'UpdatePagedDataSet' that has parameters: CONFIG_VALUE, configKey, configValue </code></pre> <p>What is the mistake i have done...??</p>
c# asp.net
[0, 9]
5,836,845
5,836,846
drop down list checked
<p>I had Drop down list which execute code when specific condition and I tried to check it through selected value but it get error </p> <pre><code> protected void DDLProductFamily_SelectedIndexChanged(object sender, EventArgs e) { if (DDLProductFamily.Items.FindByText("Name").Selected == true) using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductCategory", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", DDLProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } else if (DDLProductFamily.Items.FindByText("ProductFamilly").Selected == true) { using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductFamily", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductFamily_Id", DDLProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } } } </code></pre>
c# asp.net
[0, 9]
45,054
45,055
How to show/hide a div on mouseover?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/9564481/how-to-show-hide-a-div-on-mouseover-using-jquery">How to show/hide a div on mouseover using jquery?</a> </p> </blockquote> <p>I have a div like this:</p> <pre><code>&lt;div id="parent"&gt; foo &lt;div id="child" style="display:none;"&gt; hidden &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want to have the <code>child</code> div shown whenever someone moves their mouse over the <code>parent</code> div, and when he moves his mouse away, to hide the parent div.</p> <p>However if I do this:</p> <pre><code>$("#parent").mouseover(toggle); $("#parent").mouseout(toggle); function toggle() { console.log('here'); $("#child").toggle(); } </code></pre> <p>Then both events seem to get called twice each time i move my mouse over the #parent div. How can I achieve what I want?</p>
javascript jquery
[3, 5]
1,658,564
1,658,565
jQuery detect select in radio button
<p>I want to build form with radio buttons, where i need to detect if all radio has bee selected.</p> <p>It's quite easy function .change. In my situation:</p> <pre><code> $('input:radio').change(function() { alert($('[name|="pyt10"]:checked').val() + " / " + $('[name|="pyt11"]:checked').val() + " / "+ }) </code></pre> <p>But here is small issue - i have 3 groups of radios. When i select first radio, alert shows me, that all fields are udefined, after second select first radio has value, but second is still undefined, and so on.</p> <p>It means, that my alert shows radio value before change, not after.</p> <p>What should i do to write radio value after select ?</p>
javascript jquery
[3, 5]
1,043,109
1,043,110
Encryption of URL in asp.net 3.5
<p>How do I encrypt the URL while navigating in asp.net 3.5 ?</p>
c# asp.net
[0, 9]
1,331,837
1,331,838
want to execute a java script code .cs page
<p>i have a change password popup window.i want to send the user name and changed password to the parent window after it has been successfully changed by the popup window and want the popup to be closed after few seconds....but i am not able to call the javascript from the .cs file.i am giving the code..can u help me how to do it...`</p> <pre><code>string script = "&lt;script&gt;" + "return updateParent();"; if (!ClientScript.IsStartupScriptRegistered("someKey")) { ClientScript.RegisterStartupScript(this.GetType(), "someKey", script); } &lt;script type="text/javascript"&gt; function updateParent() { opener.document.form1.getElementById(Username).value = document.form1.getElementById(Username).value; opener.document.form1.getElementById(pswrd).value = document.form1.getElementById(new_paswrd).value; self.close(); return false; } &lt;/script&gt;` </code></pre>
javascript asp.net
[3, 9]
2,793,302
2,793,303
Add two numbers in asp.net page using Javascript
<p>Given Two text Boxes. (TextBox1 &amp; TextBox2), I want add two numbers (using the two text boxes) and show the result in the thrid textbox (TextBox3) <em>instantly</em> i.e without pressing a asp.net button. This is to be done using Javascript. I'm new to javascript so dont have much idea.</p> <p>This is the asp.net page.</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; Box1 &lt;br /&gt; &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;br /&gt; Box2&lt;br /&gt; &lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;br /&gt; Box3&lt;br /&gt; &lt;asp:TextBox ID="TextBox3" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript asp.net
[3, 9]
2,749,218
2,749,219
Easiest way to convert json data into objects with methods attached?
<p><strong>What's the quickest and easiest way to convert my json, containing the data of the objects, into actual objects with methods attached?</strong></p> <p>By way of example, I get data for a fruitbowl with an array of fruit objects which in turn contain an array of seeds thus:</p> <pre><code>{"fruitbowl": [{ "name": "apple", "color": "red", "seeds": [] },{ "name": "orange", "color": "orange", "seeds": [ {"size":"small","density":"hard"}, {"size":"small","density":"soft"} ]} } </code></pre> <p>That's all nice and good but down on the client we do stuff with this fruit, like eat it and plant trees...</p> <pre><code> var fruitbowl = [] function Fruit(name, color, seeds){ this.name = name this.color = color this.seeds = seeds this.eat = function(){ // munch munch } } function Seed(size, density){ this.size = size this.density = density this.plant = function(){ // grow grow } } </code></pre> <p>My ajax's success routine currently is currently looping over the thing and constructing each object in turn and it doesn't handle the seeds yet, because before I go looping over seed constructors I'm thinking</p> <p><strong>Is there not a better way?</strong></p> <pre><code> success: function(data){ fruitbowl.length = 0 $.each(data.fruitbowl, function(i, f){ fruitbowl.push(new Fruit(f.name, f.color, f.seeds)) }) </code></pre> <p>I haven't explored looping over the objects as they are and attaching all the methods. Would that work?</p>
javascript jquery
[3, 5]
169,138
169,139
Validate dropdown from custom control in page
<p>I have a custom control included in a form that includes a dropdown list. The form has a number of other required fields, so i was wondering how to validate this dropdown.</p> <pre><code>&lt;gaia:TextBox ID="TitleTextBox" runat="server"/&gt; &lt;gaia:RequiredFieldValidator runat="server" ControlToValidate="TitleTextBox" ErrorMessage="Please fill in the press release title" Text="*" Display="None" ValidationGroup="save" /&gt; &lt;CN:ProductCategoryDropDown runat="server" ID="ProductCategoryDropDown" /&gt; &lt;gaia:CustomValidator runat="server" ID="ProductCategoryValidator" OnServerValidate="ProductCategory_Validate" ValidationGroup="save" Display="None" Text="*" ErrorMessage="Please select a category" /&gt; </code></pre> <p>the code behind looks like this</p> <pre><code>protected void ProductCategory_Validate(object source, ServerValidateEventArgs args) { args.IsValid = (ProductCategoryDropDown.SelectedValue&gt;0); } </code></pre> <p>On the customvalidator above, I purposely left out the 'ControlToValidate' because it throws an error.</p> <p>Please help.</p>
c# asp.net
[0, 9]
1,192,370
1,192,371
How to replace text in a string without a selection
<p>How to take something like</p> <pre><code>var value = 'Hello there'; </code></pre> <p>and do a jQuery replace, like</p> <pre><code>$(value).replace('there','world'); </code></pre> <p>Every example I can find will show you how to replace text that is in an HTML object, what if it's just in JS?</p> <ul> <li><ul> - </ul></li> </ul> <p>Is there a way to do this with jquery?<br> use the $ selector to select a variable?</p>
javascript jquery
[3, 5]
1,029,729
1,029,730
how to show events link in .net calendar control?
<p>I want to develop a calendar that could show events link on it. The events will have datetime field used to locate date on calendar and it also have a link field to make hyperlink on calendar. If don't use 3rd party software, how to develop such a calendar? Any suggestion is appreciated.</p>
c# asp.net
[0, 9]
492,572
492,573
ASP Gridview drop down list selection changed, how to fill a dropdown list other than in rowDataBound()
<p>I Have a <code>gridview</code> in ASP, having <code>template Fields</code> containing <code>select</code>, <code>edit</code> and <code>delete</code> links each row, and the footer containing <code>insert</code> link.</p> <p>There are two <code>dropdownlists</code> in each row, let's say: <code>Category</code> and <code>sub-category</code>, when I change the contents of <code>category DropDownList</code> the <code>sub-category DropDownList</code> should automatically display the corresponding contents. </p> <p>I've tried to write a <code>onSelectedIndexChanged</code> handler, but I don't know how to continue. <strong>Any Ideas?</strong> <em>(bearing in mind that I did all the rowDataBound() codes to fill the Drop down lists)</em></p> <p><strong>In other words, how to populate a dropdownlist other than in row_databound()</strong></p> <p>code:</p> <pre><code>protected void grdBulkScheduler_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddlCategory = (DropDownList)e.Row.FindControl("ddlCategory"); if (ddlCategory != null) { ddlCategory .DataSource = cData.GetCategory(); ddlCategory .DataValueField = "c_ID"; ddlCategory .DataTextField = "c_Text"; ddlCategory .DataBind(); } </code></pre> <p>Here I am finding the drop down list <strong>category</strong> from <strong>GridViewRowEventArgs</strong></p> <p><strong>in the selectedIndexChanged handler, how can I find the DropDownList?</strong> <em>since <code>DropDownList ddlCategory = (DropDownList)e.Row.FindControl("ddlCategory")</code> is not working</em></p>
c# asp.net
[0, 9]
5,976,365
5,976,366
editor Issue in safari and chrome
<p>i am using CFK editor in my Asp.net Project i have an issue when the page Load in Firefox the CFK editor is avaliable with all it's options but when the page is loaded in safari or chrome the CFK editor is Disable .. please help me out. Thanks</p>
c# asp.net
[0, 9]
2,345,760
2,345,761
client side validation security issue
<p>I am validating password in javascript for null and number of characters before submitting the form. The problem is that, using firebug i can see the value entered in the password field (putting a breakpoint and hovering over the script).Is there a way to prevent this? </p>
javascript jquery
[3, 5]
1,753,390
1,753,391
How to connect server in javascript like in php mysql_connect
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8833901/connect-host-in-javascript">Connect Host in javascript</a> </p> </blockquote> <p>I need to connect my server using javascript like in php mysql_connect. Just asking for knowledge purpose. Yeah It will be the biggest mistake to connect from client side language but still want to connect using js.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,420,288
4,420,289
Asp.net Calender Event Issue
<p>i have an Issue i am developing a reservation management Issue when user Complete his/her reservation by Selecting date from Calender and when user Click on the same date again the Selection_index change event did't fire please help me out (in Hourly reservation when user click on date the Checkbox list of available hours are displayed but when user click on same date nothing happen event is't fire )</p> <p>please help me Out. Thanks</p>
c# asp.net
[0, 9]
2,831,642
2,831,643
treeview control in asp.net very slow to load nodes
<p>On my asp.net webpage, the treeview control has thousands of nodes and the tree is very slow to load. The nodes data is coming from sql database using the code below. What can we do to optimize or improve the performance.</p> <pre><code>public partial class TaxonomyAllTermsTree : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this.AddNodes(this.TreeView1.Nodes, 0, this.LoadData()); TreeView1.CollapseAll(); } } private void AddNodes(TreeNodeCollection nodes, int level, System.Data.DataTable dt) { string filterExp = string.Format("ParentID='{0}'", level); foreach (System.Data.DataRow r in dt.Select(filterExp)) { TreeNode item = new TreeNode() { Text = r[2].ToString(), Value = r[1].ToString(), NavigateUrl = "SomeURL.aspx?TermID=" + r[0].ToString() }; this.AddNodes(item.ChildNodes, int.Parse(r[0].ToString()), dt); nodes.Add(item); } } private System.Data.DataTable LoadData() { DataTable dt = new DataTable(); string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ThesaurusConnectionString"].ConnectionString; using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); SqlCommand cmd = new SqlCommand("GetFullTree", connection); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); return dt; } } } </code></pre>
c# asp.net
[0, 9]
108,563
108,564
jQuery issue in IE
<p>Hello I'm using this function as an address book module, for selecting any employee from the sidebar it display all the content of the employee. It works fine in Chrome but not in IE. I'm not able to run the src variables declared in this function in IE. Please suggest me some other ways to declare these type of variables so that these will be compatible to all browsers.</p> <pre><code>function singleSelect(id) { if(flag){ unCheckAll(); userIds=""; //userIds= document.forms['frmSidebarSearch'].elements['userIds'].value + id +","; var src = ($("#"+id).attr("src") === "&lt;@core.basePath/&gt;images/chk-box-img.gif") ? "&lt;@core.basePath/&gt;images/chk-box-img-tick.gif" : "&lt;@core.basePath/&gt;images/chk-box-img.gif"; $("#"+id).attr("src",src); var src2 = ($("#anchor"+id).attr("class") === "") ? "selected" : ""; $("#anchor"+id).removeClass().addClass(src2); var elementss = document.getElementById("all").getElementsByTagName('img'); for(i=0;i&lt;elementss.length;i++) { if($("#"+elementss[i].id).attr("src") === "&lt;@core.basePath/&gt;images/chk-box-img-tick.gif"){ userIds= userIds +"," +elementss[i].id; } } unHilightAll(); highLightIndex(id); document.forms['frmSidebarSearch'].elements['userIds'].value=userIds; $('#frmSidebarSearch').ajaxSubmit({target:'#content',url:'&lt;@core.basePath/&gt;sp/manager/manageraddressbook/manager/'+id}); } flag = true; } </code></pre>
javascript jquery
[3, 5]
303,384
303,385
How to check that this event would occur after DOM is ready in jquery?
<p>I want to get page_tag information from the page and want to make sure that DOM for this page is already ready before getting the page tag information. </p> <p>I am doing </p> <pre><code>$(document).ready( { alert("test"); var page_tag : $("head meta[name='page_tag']").attr('content'); page_tag : (page_tag) ? page_tag : ''; } </code></pre> <p>But it gives me errors, </p> <pre><code>missing : after property id alert("Check if document is ready");\n </code></pre> <p>Any suggestions on what could be the possible reasons for it or any other way of checking if the dom is ready or not before getting page_tag information. </p>
javascript jquery
[3, 5]
4,563,211
4,563,212
recognize position of element with jquery
<p>i've got a little pictureblog and would like to add the same affect like in the google reader. That means if a picture is in the center of my screen it should get a border. In the following example i relized similar thing with the hover effect. but this is not exactly what i want. How can i realize that with jquery? </p> <pre><code>$(".blogentry").hover( function() {$(this).css("border", "1px solid gray");}, function() {$(this).css("border", "1px dotted gray");} ) </code></pre> <p>Thank You!</p>
javascript jquery
[3, 5]
3,522,874
3,522,875
which language is better for my application?
<p>I want to design a professional software. Features :</p> <ol> <li>Direct Connection with SQL</li> <li>HTML code editing and build</li> <li>Search among thousands of content files (Advance search)</li> <li>Artificial intelligence (Simple)</li> <li>Compress/Extract files</li> <li>Create a Private file Extension</li> <li>Encrypt/Decryption</li> </ol> <p>And users most can make a modules and plugins for software</p> <p>Now which language is best for my application? C#.NET or C++/CLI</p> <p>thanks before your answer</p>
c# c++
[0, 6]
5,688,872
5,688,873
Type casting to datetime
<p>I got data from JSON like "/Date(1285871400000)/" ,but i want to convert in "dd/mm/yyyy".</p>
javascript jquery
[3, 5]
2,617,553
2,617,554
Take EditText with decimals value for preforming mathematics
<p>All- I have an EditText field where the user enters a currency value (eg. "120.45"). I need to take that value and use it in an equation. The problem is, the decimal point gets ignored so instead of multiplying 120.45 by 2 it multiples 12,045 by 2. Is there any way to make the equation see this value as "120.45". Here is my XML:</p> <pre><code>&lt;EditText android:id="@+id/edit_bill" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/view_dollar_sign" android:layout_alignBaseline="@id/view_dollar_sign" android:padding="5dp" android:singleLine="true" android:hint="@string/edit_bill" android:digits="0123456789." android:maxLength="6" android:gravity="right" android:layout_alignBottom="@id/view_dollar_sign" /&gt; </code></pre> <p>Here is my code: </p> <pre><code>EditText text = (EditText)findViewById(R.id.edit_bill); String value = text.getText().toString(); if(!value.contains(".")) value = "."+value; float bill = Float.parseFloat(value); </code></pre> <p>Thanks in advance! </p>
java android
[1, 4]
4,385,428
4,385,429
Domain look up in asp.net
<p>In my asp.net application I want to use the look up domain information (ie WHOIS information). When a user enters any domain name it has to look up and display the information. Is there any code library or script I can use to accomplish this?</p>
c# asp.net
[0, 9]
4,196,387
4,196,388
If parent element does not contain certain child element; jQuery
<pre><code>&lt;div class="test"&gt; &lt;div class="example"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="test"&gt; &lt;/div&gt; </code></pre> <p>How can I apply jQuery to an element with the class <code>test</code> only if it doesn't contain a child element with the class <code>example</code>?</p>
javascript jquery
[3, 5]
1,064,658
1,064,659
Passing part of a URL to PHP and return results from a database
<p>I'm working on an interactive map and I am wondering if it's possible to pass part of a URL to a PHP script and have it look up information and then fetch it back to display within an iframe in a lightwindow.</p> <p>The map is CSS based and each the link on each state within the href contains the state name (e.g. - #statename).</p> <p>When a user clicks on the map, the #statename is appended to the URL.</p> <p>I'm wondering that if it's possible to pass that part of the URL (#statename) to PHP and have it run the script from there?</p> <p>Here's a link to the interactive map that I am working on. If you click on the state of Texas you'll see what I mean:</p> <p><a href="http://sjdunham.com/beta/maptest/" rel="nofollow">http://sjdunham.com/beta/maptest/</a></p>
php javascript
[2, 3]
5,030,334
5,030,335
JavaScript functions prevent C# functions from being executed?
<p>On my aspx page I have two buttons. One calls some javascript and the other calls a C# function on the code-page. When I call the javascript file in the head of the document, the JavaScript function works well but the C# does not. Clicking on the button does not do anything. If I remove the javascript call then the C# function works normally.</p> <p>How can I overcome this? It seems as if it is expecting to find the C# function within the JavaScript file.</p> <p>ASP:</p> <pre><code>&lt;head&gt; &lt;script src="MyFunctions.js" language="javascript" type="text/javascript"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;asp:Button id="btn1" Text="Submit" runat="server" OnClick="buttonSumbit_Click" /&gt; &lt;asp:Button id="btn2" Text="Show" runat="server" OnClientClick="buttonShow_Click()" /&gt; &lt;/body&gt; </code></pre> <p>C#:</p> <pre><code>protected void buttonSumbit_Click(object sender, EventArgs e) { //SOME CODE HERE } </code></pre> <p>JavaScript:</p> <pre><code>function buttonShow_Click() { //SOME CODE HERE } </code></pre>
c# javascript asp.net
[0, 3, 9]
1,270,172
1,270,173
Remove class second and add new class instead
<p>How can removed class <code>Second</code> and add new class <code>Third</code>?</p> <p>I try as, but this don't work:</p> <pre><code>&lt;div class="First Second"&gt;&lt;/div&gt; $('div').removeClass().split(" ")[1].addClass('Third'); </code></pre>
javascript jquery
[3, 5]
1,893,650
1,893,651
Does using jQuery.get effectively double the ping time?
<p>Suppose I have some script myScript.js that uses jQuery.get() to retrieve a small piece of data from the server. Suppose also that my ping time is horrible at 1500ms. Does using jQuery.get effectively double the ping time to 3000ms? </p> <p>Or is there async magic that allows some sort of parallel processing? The reason I'm asking is that we use jQuery.get() fairly liberally and I'm wondering if it is an area we need to look at optimizing.</p> <p>Edit: double compared to if I can somehow rearrange things to just load all the data upon the initial load and bypass jQuery get altogether</p>
javascript jquery
[3, 5]
2,036,229
2,036,230
Android: Change Bitmap image displayed on Canvas
<p>I am drawing a bitmap in my onDraw and want to be able to change that image when a user clicks on a certain part of the screen. I display the image like this...</p> <pre><code>protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawColor(Color.WHITE); canvas.drawBitmap(mallMap, 0, 0, null); canvas.drawLines(pts, paint);} </code></pre> <p>then in my onTouch method I'd like to be able to redraw a different bitmap</p> <pre><code>public boolean onTouchEvent(MotionEvent event) { final int action = event.getAction(); final int x = (int) event.getX(); final int y = (int) event.getY(); if (action == MotionEvent.ACTION_DOWN) { Canvas.drawBitmap(lowerLeft, 0, 0, null); return false;} </code></pre> <p>is something like this possible? I need to stick with a canvas and am not sure how I would got about doing this.</p> <p>Thanks.</p>
java android
[1, 4]
915,858
915,859
Delete does not ask for confirmation
<p>When Delete button is clicked, the confirmation box should pop up if the selected node has child nodes. Otherwise, it should not do anything.</p> <p>Right now, when I click on delete, it just deletes without confirming.</p> <p>Here is the code:</p> <pre><code> &lt;asp:Button ID="btn_delete" runat="server" Height="32px" onclick="btn_delete_Click" OnClientClick = "return childnode();" Text="Delete" Visible="False" /&gt; &lt;script type="text/javascript"&gt; function childnode() { var treeViewData = window["&lt;%=nav_tree_items.ClientID%&gt;" + "_Data"]; var selectedNode = document.getElementById(treeViewData.selectedNodeID.value); if (selectedNode.childNodes.length &gt; 0) { return confirm("heloo"); } return false; } &lt;/script&gt; </code></pre>
c# javascript asp.net
[0, 3, 9]
2,690,957
2,690,958
Why does everyone like jQuery more than prototype/script.aculo.us or MooTools or whatever?
<p>It seems that jQuery has taken the throne for JavaScript frameworks and I was wondering exactly why. Is there a technical reason for this or is it just that they have evangelists? I have been really happy with using <a href="http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework">Prototype</a> myself. Should I use jQuery for my next project?</p>
javascript jquery
[3, 5]
2,392,765
2,392,766
regarding asp.net regular expression
<p>i have a textbox and i am using a regular expression in asp.net and i want my user to enter in this format cat10 as cat followed by numbers so what should be my regular expression</p>
c# asp.net
[0, 9]
1,973,928
1,973,929
How to programmatically get session cookie name?
<p>The default cookie name for the Session Id in ASP.NET is <code>ASP.NET_SessionId</code>. It's also possible to change this name to something else like <code>&lt;sessionState cookieName="FooBar" /&gt;</code>. </p> <p>Is there a member to easily access this name like with <code>FormsAuthentication.FormsCookieName</code>?</p>
c# asp.net
[0, 9]
3,678,072
3,678,073
Jquery binding events
<p>Why does the handler bound to an event of an element fire the wrong result? I would expect the click event of Div1 below to popup a dialog stating 'div1' but it popup's 'div2'.</p> <p>I am new to this and I am scratching my head to work out why this is happening. I would appreciate any help to explain.</p> <p>Cheers,</p> <p>Alex</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;TestEvents&lt;/title&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //Object Array var objToTest = [{ TabName: "div1" }, { TabName: "div2"}]; //Adds events to each div function TestWhatIsGoingOn(myObjToTest) { for (i in myObjToTest) { $('#' + myObjToTest[i].TabName).click(function() { TestResult('TabName: ' + myObjToTest[i].TabName); }); } } function TestResult(message){ alert(message); } $(document).ready(function() { TestWhatIsGoingOn(objToTest); }); &lt;/script&gt; &lt;style type="text/css"&gt; #div1, #div2 { border: solid thin black; height: 100px; width: 300px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id='div1'&gt;div1; click here to show expected result: 'TabName: div1'&lt;/div&gt; &lt;div id='div2'&gt;div2; click here to show expected result: 'TabName: div2'&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
5,543,091
5,543,092
Don't load the image until user scroll to there , possible?
<p>If I don't want the image to be downloaded from server , until user scroll to there , which event should I capture ? </p> <p>And how ?</p>
javascript jquery
[3, 5]
4,497,226
4,497,227
Read asp.net dynamic textbox content length using c#
<p>I am using the below code to create a dynamic textbox and their onchange event.Event fired successfully and it doesn't return any value.Please help me to solve this.</p> <pre><code>txt_box.Attributes.Add("onchange", "loadValues('" + txt_box.ClientID + "')"); function loadValues(controlName) { alert(controlName); //control name comes here var txtValue = document.getElementById(controlName); //control also return null if (txtValue.value.length &gt; 0) { alert(txtValue.value.length); } } </code></pre>
c# javascript asp.net
[0, 3, 9]
3,794,413
3,794,414
Inserting characters into a string - most efficient
<p>I need to insert a character into a string, A, every place there is a character B.</p> <p>For example xxxxxxxxBxxxxxxxxxxxxxxxxxBxxxxxxxxxxxxB</p> <p>becomes</p> <p>xxxxxxxxxxxABxxxxxxxxxxxxxxxABxxxxxxxxxxxxxxxxxxxAB</p> <p>I see that Javascript (replace) and PHP (str_replace) have replace functions, so that I can just replace each occurence of B with AB.</p> <p>Is this the most efficient way to do this?</p>
php javascript
[2, 3]
2,983,639
2,983,640
Activity crash when using sqllite in my custom class - android
<p>So i created this class :</p> <pre><code>public class Database extends Activity { public SQLiteDatabase db ; public void openDb(){ db = openOrCreateDatabase("myDB",MODE_PRIVATE,null); db.close(); } } </code></pre> <p>And in my main activity i wrote that : </p> <pre><code>public class Splash extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); Database ODB= new Database (); ODB.openDb(); } } </code></pre> <p>When I launch that I get force closing windows and when I put that in try-catch I get <code>NullPointerException</code> .</p> <p>Does anyone know what I am doing wrong?</p>
java android
[1, 4]
790,705
790,706
How do I retrieve the name property of a radio button in c#
<p>I've created a series of radio button controls in C#. (radCompany, radProperty etc.)<br /> I've set their group name to be the same (282_Type) so they function as a list of radio buttons. </p> <p>How do I retrieve the name (like: ct100$m$dfgadjkfasdghasdkjfg$282_Type) in c# so I can use this in a Javascript method i'm creating?</p> <p>The values output are:<br /> Radion Button 1<br /> id="ct223423432243_radCompany" name="ct100$sdfsdf$sdfsdf$282_Type"<br /> Radion Button 2<br /> id="ct223423432243_radProperty" name="ct100$sdfsdf$sdfsdf$282_Type" </p>
c# javascript
[0, 3]
4,460,543
4,460,544
Code not reaching SelectedIndexChanged event
<p>I've a user control contined in <code>MyPage.aspx</code>. The user control contains few drop-down lists; each with <code>Autopostback = true</code> but when I run the code &amp; change the drop-down item, other events gets fired but not <code>SelectedIndexChanged</code>.</p> <pre class="lang-xml prettyprint-override"><code>&lt;asp:DropDownList ID="ddPages1" runat="server" EnableViewState="true" AutoPostBack="true" onselectedindexchanged="ddPages1_SelectedIndexChanged"&gt; &lt;/asp:DropDownList&gt; </code></pre> <p>Code behind of ascx:</p> <pre><code>protected void ddPages1_SelectedIndexChanged(object sender, EventArgs e) { ... } </code></pre> <p>ascx also has <code>ReportViewer</code> &amp; I'm populating number of pages in the report into drop-down list.</p> <pre><code>protected override void Render(HtmlTextWriter writer) { TotalPages = ReportViewer1.LocalReport.GetTotalPages(); txtPageCount1.Text = Convert.ToString(TotalPages); if (TotalPages &gt; 0) { for (int i = 1; i &lt;= TotalPages; i++) { ListItem listItem = new ListItem(); listItem.Value = i.ToString(); listItem.Text = i.ToString(); ddPages1.Items.Add(listItem); } } base.Render(writer); } </code></pre>
c# asp.net
[0, 9]
3,450,329
3,450,330
Is it possible to embeded js into c#
<p>Currently I'm involved in a project using c# . I know some of the features of this project can be easily implemented using Javascript (I have been a js developer for some time, but totally new to c#). so I'm very eager to know if it is possible to reuse the available js code in the project, or put it another way, embeded js into c# .</p> <p>thanks in advance.</p>
c# javascript
[0, 3]
766,602
766,603
onclick submit one of two same form
<p>I included one file (containing a form) two times in php file.I want to submit one form with onclick function. both forms are same. i wrote onclick function document.formname.submit();</p> <p>I want to do somthing like this document.this.form.submit(); please give some solution.</p>
php javascript jquery
[2, 3, 5]
4,546,700
4,546,701
app_code files not found by the project
<p>my name is samy and im going insane!</p> <p>i got this problem that my class's in app_code are no visible afther im uploading them to the server. localy every thing work fine.</p> <p>i read some other qustions on this when a lot of answer were like this:</p> <p>"Right-click on the item in the solution explorer, and select Properties. In the properties window, there is a Build Action option."</p> <pre><code> *when i right click i cant see any proprty button so i used F4 but then i cant see any build option only "Custom Tool", "File Name" , "Full Path". </code></pre> <p>and "you need to publish your website first." *this didnt work either.</p> <p>or "your class are not compiled. *i tried to build solution and that didnt work either.</p> <p>please help me becuse im starting read/see tutorials on how to make a good rope knots (this will probly fails too so dont worry to much lol)</p> <p>this is the error im getting (its look like this becuse im using iframe) <a href="http://img14.imageshack.us/img14/11/theerrorb.png" rel="nofollow">http://img14.imageshack.us/img14/11/theerrorb.png</a></p> <p>this is error i get if i publish the site and upload it to the server all the app_code files are compiled in the bin folder as you said.</p> <p><a href="http://img193.imageshack.us/img193/4436/errorifipublish.png" rel="nofollow">http://img193.imageshack.us/img193/4436/errorifipublish.png</a></p>
c# asp.net
[0, 9]
1,452,921
1,452,922
How do I store data in array within a loop jQuery
<p>How do I store data in array within a loop?</p> <pre><code> var images; var i = 0; $('#cover div').each(function() { alert($(this).attr('id')); //I should store id in an array }); &lt;div id="cover"&gt; &lt;div id="slider_1"&gt;&lt;p class="content"&gt;SLIDER ONE&lt;/p&gt;&lt;/div&gt; &lt;div id="slider_2"&gt;&lt;p class="content"&gt;SLIDER TWO&lt;/p&gt;&lt;/div&gt; &lt;div id="slider_3"&gt;&lt;p class="content"&gt;SLIDER THREE&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
241,969
241,970
Modal dialog message truncated in firefox
<p>I am using a Modal dialog to prompt user a message. It works fine in IE but shows only first row in firefox. How can i fix this. This is how my message is formatted.</p> <pre><code> var modal = "&lt;div id='modal_pop'&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt; " + "Please check you have a valid value to proceed.&lt;br&gt; Change the value if possible. Value should be valid to proceed further.&lt;br&gt;" + "Value should not be a number or a special case character&lt;br&gt; Make changes and save the work before exiting it.&lt;br&gt; " + "Click logoff now or continute using the application.&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/div&gt;"; </code></pre> <p>and this is the jQuery dialog:</p> <pre><code>var showPopup = function() { $(modal).dialog({ buttons: { "Test": function() { //ABC }, "Test1": function() { //XYZ } }, modal: true, width: 430, height: 100, resizable:'yes', scroll:'no' }); } </code></pre>
javascript jquery asp.net
[3, 5, 9]
4,077,178
4,077,179
jQuery problems
<p>Below I present you some code which has completely been butchered by me.</p> <pre><code>$(".gig").hover(function() { var id = $(this).attr("id"); var time = $(this).attr("title"); function () { if (time &gt; 0) { var answer = $('&lt;div class="roll"&gt;Are you attending? &lt;a href="' + id + '"&gt;Yes&lt;/a&gt;&lt;/div&gt;').hide(); } else { var answer = $('&lt;div class="roll"&gt;Did you attend?&lt;a href="' + id + '"&gt;Yes&lt;/a&gt; &lt;/div&gt;').hide(); } answer.appendTo($(this)).fadeIn("fast"); } function () { $(this).find("div:last").fadeOut("fast", function() { $(this).remove() }); } }); </code></pre> <p>I know, it is terrible. It basically is like pseudocode now. Could anyone help me to re-write my mess into actually functioning code?</p> <p>Basically for every class named div, it should append the variable answer onto the end of this div, and on mouseout, remove the variable answer. The variable time will be fetched from the title of the rollover div, and thus affect what is shown in the new div that is added. The id of the .gig should simply be passed into the url.</p> <p>The hover answer add/remove functions work on their own, but I am unable to place them into the new function with the if and new variables.</p> <p>Thank you so much.</p>
javascript jquery
[3, 5]
2,270,876
2,270,877
display dropdownlist box option on jgrid
<p>I have a drop down list box where i display timezone with gmt hours.<br> Now I want to display this option in Jgrid. Is it possible?</p> <pre><code>for(..) { &lt;option value=&lt;%=tzone.getTimeZoneID() %&gt; &gt; &lt;%=tzone.getTimeZoneName() %&gt; &lt;/option&gt; } </code></pre> <p>In js file, i use </p> <pre><code> var timeZone = $("#backDropDownTimezone").val(); </code></pre> <p>hence only id is displayed but i want to display timezone name.</p>
java jquery
[1, 5]
5,032,969
5,032,970
Unknown getSystemService()
<p>So I'm following along with <a href="http://codehenge.net/blog/2011/05/customizing-android-listview-item-layout/" rel="nofollow">this tutorial</a>, and I'm stuck. In Eclipse, I'm getting an error saying that "The method getSystemService(String) is undefined for the type UserItemAdapter". Any idea how I can get this from a Context? I'm kinda confused, I haven't done much with with Contexts.</p>
java android
[1, 4]
778,970
778,971
Using the OnInit event in asp.net
<p>I have contentpage overriding the OnInit event of a masterpage. The override works fine, until I put a custom user control on the page: in this case the OnInit event does not fire for the contentpage (no overrides are used in the user control)</p> <p>What are the possible causes/solutions for this? (I use the OnInit event to create dynamic controls)</p> <p><hr /></p> <p><strong>Edit:</strong></p> <p>now i tried this in the content page:</p> <p>(The OnPreInit part runs, but Masters_Init does not get called...)</p> <pre><code> protected override void OnPreInit(EventArgs e) { base.Master.Init += new EventHandler(Masters_Init); } void Masters_Init(object sender, EventArgs e) { //code } </code></pre>
c# asp.net
[0, 9]
5,184,196
5,184,197
unable to access webmethod of a webservice using jquery ajax() method
<p>I am unable to access webmethod of a webservice using jquery ajax() method. My webservice is in website/Afolder/webservices folder. And I am calling the webmethod ina user control which is inside website/Afolder/usercontrol folder. The user control is in a page which is inside website/Afolder folder.What should be the value of my url to call the webmethod?</p> <pre><code>$.ajax({ type: "POST", url: "/WebServices/AMyService.asmx/ReturnDates", data: "{'args':'" + $('#&lt;%= DropDownListTimeFrame.ClientID %&gt;').val() + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { } }); </code></pre>
jquery asp.net
[5, 9]
2,266,584
2,266,585
$ is not defined: What does this mean?
<p>I get a JS error and I can't figure out how to fix it.</p> <p>When my page loads up, IE7 notifies me of a run time error. In addition, my Firebug on Firefox warns me of an error:</p> <pre><code>$ is not defined (?) [Break on this error] $(document).ready(function() { $("a#sin...Out': 300, 'overlayShow': false }); }); </code></pre> <p>When I go to the lines in question its this:</p> <pre><code>&lt;script type="text/javascript" src="/templates/magazeen/js/jquery/jquery.dropdown.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("a#single_image").fancybox(); $("a#inline").fancybox({ 'hideOnContentClick': false }); $("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false }); }); &lt;/script&gt; </code></pre> <p>Any help please.</p>
javascript jquery
[3, 5]
4,199,579
4,199,580
Redirect and bind server-side control without refresh
<p>I'm using a repeater on my page. I want to populate this repeater based on a selection from a dropdown but with no page refresh.</p> <p>Here is the sequence of events:</p> <ol> <li>user selects an item in a dopdown</li> <li>Show the results (bind a server-side control and then render it back to the page)</li> </ol> <p>Now to show the results I need to call a server-side method where I pass a couple Ids from the client to the server and then the server rebinds the control using some logic in the code-behind of this page.</p> <p>Not sure if this is possible. I tried to do a redirect and send the values through a querystring but obviously that performs a refresh of the page.</p> <p>I'm simply trying to call a code-behind (server-side) method after the user selects a dropdown item and then just paint the results from the now bound repeater on the page using jQuery's .html().</p> <p>I think this isn't possible with a repeater because it's server-side right? If not I'll just have to make a jquery ajax call to my handler like I've done and just paint the response html that I created back to a div on the page to create the list instead of a repeater.</p> <p>I ask because I'm trying to also use the <a href="http://www.trirand.net/demoaspnetmvc.aspx" rel="nofollow">jqGrid</a>...figured there was a way I can update the grid after a user selects something in another dropdown on my page and perform some kind of ajax call to somehow bind that grid but the jqGrid is a server-side control...so I do not think it's possible?</p>
jquery asp.net
[5, 9]
5,385,716
5,385,717
In Java what is idomatically most similar to raising a Python ValueError?
<p>If I were writing a Python function which received an argument with the correct type, but a value out of bounds, then I might throw a ValueError or one of it's sub-classes.</p> <p>For example, suppose I had a function which added up the prices on an invoice. If one of the prices had a negative value or one of the item-counts was not positive and non-zero I might raise VE.</p> <p>My current project is in Java, but the situation is the same:</p> <p>A pricing function accepts only numbers within a specific range - what's the most sensible kind of exception object to throw that tells another Java developer their input is out of that sensible range?</p>
java python
[1, 7]
20,376
20,377
Creating dynamic hyperlink in asp.net using c#
<p>In my application I have DataSet containing name and Id of user and I want to create a dynamic hyperlink of the all the user name. Please anyone tell me how to create dynamic hyperlink using C#.</p>
c# asp.net
[0, 9]
600,565
600,566
what will be the value of 'this'?
<p>I want to know this because i have to change cell style during editing from menu button like spreadsheet.below code is not working properly.</p> <pre><code>$("#tab1 tr td:not(:first-child)").on("click", function (e) { console.log(e); if(e.currentTarget.contentEditable != null){ $(e.currentTarget).attr("contentEditable",true); } else{ $(e.currentTarget).append("&lt;input type='text'&gt;"); } }); //Add bold text $("#tab1 tr td:not(:first-child)").on("click", function () { var mytd=this; $("#btn4 li a:eq(0)").on("click",function() { $(mytd).toggleClass("bold"); $(this).toggleClass("bg"); }); }); </code></pre>
javascript jquery
[3, 5]
3,038,816
3,038,817
How to perform jquery actions on elements not yet visible
<p>I have a textarea in a div that I need to call a jquery function on to activate my rich textbox. The div is initially hidden and becomes visible through a button click on the server side:</p> <pre><code>&lt;div id="RichTextDiv" style="display:none"&gt; &lt;textarea id="RichText" /&gt; &lt;/div&gt; &lt;script type="text/javascript" language="javascript"&gt; $(document).ready(function () { $("#RichText").markItUp(mySettings); } &lt;/script&gt; </code></pre> <p>The above code doesn't work because RichTextDiv is not visible during page load. I need to perform the markItUp() action on RichText as soon as it becomes visible. How can this be achieved in jquery?</p> <p>Thanks...</p>
javascript jquery
[3, 5]
274,856
274,857
JavaScript, / jQuery determining if the URL contains a Min String
<p>Here's what I want to happen</p> <p>Anything the variable hash contains: #/projects/X</p> <p>X being anything other than blank, I want to fire an alert</p> <p>Fires Alerts</p> <pre> #/projects/X #/projects/X/boo/123/123/ads/asd/ads/ads </pre> <p>Does not fire an alert</p> <pre> #/projects/ </pre> <p>Suggestions?</p>
javascript jquery
[3, 5]
5,793,312
5,793,313
What is wrong with this If/Else code?
<p>I have a "Change" button that makes a form active or locked when clicked. Though the button only works when I click "change", and then doesn't :/</p> <pre><code>&lt;div class="holder"&gt; &lt;div class="question active"&gt;Q1&lt;input id="one" type="text"&gt; &lt;div class="button passive"&gt;&lt;input type="button" value="Change" id="changeone"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; $('input#changeone').click(function() { if( $('#one').attr('readonly', true) ) { $("#changeone").attr('value', 'Save'); $('div.button').parent().css('background-color', 'red'); $('#one').attr('readonly', false); } else { $("#changeone").attr('value', 'Change'); $('div.button').parent().css('background-color', 'green'); $('#one').attr('readonly', true); } }) </code></pre> <p>THANKS :)</p> <p>**corrected indentation</p> <p>THANK YOU ALL! You all responded so quickly and I thank everyone for their time :)</p>
javascript jquery
[3, 5]
3,030,876
3,030,877
jQuery statements which interact with the DOM not working on 'soft' refresh only, but console log statements are
<p>I feel like I am banging my head against a wall right now; I know it has been reported, in jQuery 1.8.0, that the <code>document.ready</code> function is firing too early in IE 9 &amp; 10. However I have the following snippet of code running under jQuery latest (1.9.1):</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { window.ie = (function(){ var undef, v = 3, x = 9, div = document.createElement('div'), div2 = document.createElement("div"), all = div.getElementsByTagName('i'), bs = div2.getElementsByTagName("b"); while ( div.innerHTML = '&lt;!--[if gt IE ' + (++v) + ']&gt;&lt;i&gt;&lt;/i&gt;&lt;![endif]--&gt;', all[0] ); while ( div2.innerHTML = '&lt;!--[if lte IE ' + x + ']&gt;&lt;b&gt;&lt;/b&gt;&lt;![endif]--&gt;', bs[0] ) { $("body").addClass("lteie" + x--); } if(v &gt; 4) $("body").addClass("isie" + v); return v &gt; 4 ? v : undef; }()); }); &lt;/script&gt; </code></pre> <p>This works when I refresh from server but it is not working when I use <code>ctrl + R</code> or <code>f5</code>. I am running this app locally. Not sure if this is important but I have tried setting it to always refresh from server via dev tools, refreshed once with success and then disabled this setting and it still doesn't run this script fully - it seems that if I put an alert in there, or console.log, it works fine (doesn't add the classes but does alert or write to the console even when put <em>within</em> the while loop). If it refreshes from server or using <code>ctrl + f5</code>, surely the cached copy should be replaced, right?</p> <p>Thanks in advance, Regards, Richard</p>
javascript jquery
[3, 5]
1,613,429
1,613,430
How to use parameters as object property?
<p>In PHP we do it like this:</p> <pre><code>function($param) { $this-&gt;{$param}; } </code></pre> <p>How can we do it in JavaScript?</p>
php javascript
[2, 3]
5,665,061
5,665,062
Internal loop only runs once, containing loop runs endlessly
<p>noob question I'm afraid. </p> <p>I have a loop that runs and rotates the hand of a clock and an internal loop that checks the angle of the hand if it is 90, 180, 270 and 360. On these 4 angles the corresponding div is displayed and its siblings removed. The hand loops and loops eternally, which is what I want, but the angle check only runs the loop once through the whole 360. As the hand passes through the angles it is correctly displaying and removing divs but is doesn't continue after the first revolution of the clock. </p> <p>I've obviously messed up somewhere and there is bound to be a more efficient way of doing all this. I am using jQueryRotate.js for my rotations. Thanks for your time. </p> <pre><code>jQuery(document).ready(function() { var angle = 0; setInterval(function() { jQuery("#hand").rotate(angle); function movehand() { if (angle == 90) { jQuery("#intervention").fadeIn().css("display","block").siblings().css("display","none"); } else if (angle == 180) { jQuery("#management").fadeIn().css("display","block").siblings().css("display","none"); } else if (angle == 270) { jQuery("#prevention").fadeIn().css("display","block").siblings().css("display","none"); } else if (angle == 360) { jQuery("#reaction").fadeIn().css("display","block").siblings().css("display","none"); } else { movehand; } }; movehand(); angle+=1; },10); }); </code></pre>
javascript jquery
[3, 5]
3,762,305
3,762,306
Convert Base64 String to ImageView
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5441761/convert-base64-string-to-imageview">Convert Base64 String to ImageView</a> </p> </blockquote> <p>I have a byte that i get from base64.decode method</p> <p>when i buil a bitmap to use in a imageview?</p>
java android
[1, 4]
1,477,681
1,477,682
Does activity requires Handler in android?
<p>In an Android module, does an activity requires Handler to be defined ?</p>
java android
[1, 4]
1,061,170
1,061,171
jQuery inArray - problems
<p>Say I have a variable <code>a</code> with the value:</p> <pre><code>1 </code></pre> <p>Then I have an array <code>b</code> with the values:</p> <pre><code>[1, 2] </code></pre> <p>Why does <code>$.inArray(a, b)</code> give me a -1? I should be getting <code>0</code>, right?</p>
javascript jquery
[3, 5]
715,310
715,311
Jquery or javascript auto click
<p>How can i auto click on the link on page load? i have been trying for ages but id doesn`t work.</p> <pre><code>&lt;link rel="stylesheet" type="text/css" href="leightbox.css" /&gt; &lt;script type="text/javascript" src="prototype.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="leightbox.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="content"&gt; &lt;p&gt; &lt;a href="#" class="lbOn" rel="pop02"&gt;Click here to activate leightbox popup.&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;!----------// POPUP (ON CLICK) //----------&gt; &lt;div id="pop02" class="leightbox"&gt; &lt;a href="#" class="lbAction" rel="deactivate"&gt;×&lt;/a&gt; &lt;div class="scrollbox"&gt; &lt;h1&gt;This popup loads upon clicking a trigger link.&lt;/h1&gt; text&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]