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
5,987,650
5,987,651
HTML encode asp.net tree view nodes
<p>I would like to know how to html encode nodes in a asp.net treeview control? I have a requirement that requires the nodes to have items that accepts "&lt;" ">" symbols.</p> <p>The code sample below is what I'm currently using as a treenode.</p> <pre><code>public class SampleTreeNode : TreeNode { public SampleTreeNode(string text, string value) : base(HttpUtility.HtmlEncode(text), value) { } } </code></pre> <p>The problem with this is that when I put it a node with text "". It displays the text as "&lt;Test&gt;" instead of "". I'm not sure if this is the best place to put the encode command.</p>
c# asp.net
[0, 9]
2,781,370
2,781,371
how do i stop a form submit with jQuery
<p>I have this form <a href="http://posnation.com/shop_pos/" rel="nofollow">here</a> and i dont want them to go to the next page without certain selections</p> <pre><code>&lt;form method="post" action="step2/" id="form1"&gt; .... .... .... &lt;input type="submit" class="submit notext" value="Next" /&gt; </code></pre> <p>and here is my jquery</p> <pre><code>$('.submit').click(function(e) { var business = $(".business_type_select").find('.container strong').text(); alert(business); if(business == "Select Business Type"){ alert("BusinessBusinessBusiness"); e.preventDefault; return false; } }); </code></pre> <p>any ideas what i am missing to get this to stop submitting</p>
javascript jquery
[3, 5]
3,718,761
3,718,762
How to add a fade-in effect in jQuery text
<p>How to add a fade-in effect when the data is returned to the <code>#results</code> div?</p> <pre><code>$('#results').html(data); </code></pre> <p>I tried</p> <pre><code>$('#results').html(data).fadeIn('slow'); </code></pre> <p>but it doesn't seem to work</p> <p>My code</p> <pre><code> submitHandler: function(form) { // do other stuff for a valid form $.post('mailme.php', $("#myform").serialize(), function(data) { $('#results').html(data).fadeIn('slow'); }); } </code></pre>
javascript jquery
[3, 5]
5,722,553
5,722,554
How to show dropdownlist dynamically
<p>I am using grid view to display data from database. There is a status column which holds 3 values. I wan the user to be able to change the value using a dropdownlist in the grid which will be visible when the user clicks on the ChangeStatus but which is present on each row.Any ideaa how to achieve this??</p>
c# asp.net
[0, 9]
1,090,442
1,090,443
Adding OutPutCache to Control Definition Alters its Class ...?
<p>I'm working on a web app (CMS) that loads controls dynamically into a holder page. Using .Net version 3.5.</p> <p>All my controls inherit from a custom base class.</p> <p>So at runtime I have a bit of code that does something like this:</p> <pre><code>Sarx.cms.BaseControl bctl = (Sarx.cms.BaseControl)LoadControl(sourceOfTheControl); </code></pre> <p>All was fine until I added an outputcache directive to the control definition (in the markup).</p> <p>No, the above cast fails with an InvalidCastException.</p> <p>I looked at the Control that is the output of the LoadControl and cast, and the runtime reports it is now of type PartialCachingControl:</p> <pre><code>Control c1 = LoadControl(PageData.PageApplications[i].Source); c1.GetType() </code></pre> <p>UnderlyingSystemType: {Name = "PartialCachingControl" FullName = "System.Web.UI.PartialCachingControl"}</p> <p>I'd appreciate it if someone could explain and/or suggest a workaround.</p> <p>Thanks in advance,</p> <p>5arx</p>
c# asp.net
[0, 9]
2,870,775
2,870,776
Set the ViewState of the parent class in the child class asp.net
<p>I am working on an existing portal wherein I have a class which is inheriting from another class. In the base class the <code>Page.EnableViewstate</code> has been set to <code>false</code> as shown below.</p> <pre><code>Page_Load() { Page.EnableViewState=false; } </code></pre> <p>However in the child class am using Gridview to display certain details from the backend. When the <code>Page.EnableViewstate=false</code> in parent page, the gridview doesn't get displayed. </p> <p>Is there a way to enable the viewstate of the parent class in the child class? I am badly in need of the base class but the Page.<code>EnableViewState</code> has to be set to false in that page for some reason. Any help is most valuable!!</p>
c# asp.net
[0, 9]
668,069
668,070
How do people name the $(this) when it's used within code?
<p>I have the following code:</p> <pre><code>$('#detailData') .on('change', '.updatable', function () { var type = $(this).attr('id').split('_')[1]; updateField(entity, $(this), type); return false; }) </code></pre> <p>I would like to add to the code and use <code>$(this)</code> multiple times. To make it clear, I want to assign <code>this</code> to a variable. When I use jQuery I've seen people place a <code>$</code> before the variable name. Am I correct in saying the following is correct?</p> <pre><code>var $abc = $('#abc'); </code></pre> <p>If that's correct then how should I name <code>$(this)</code> which if I am understanding correctly points to a DOM variable. Also is there any difference between a DOM variable and what's returned with <code>$('#abc')</code>?</p>
javascript jquery
[3, 5]
1,341,326
1,341,327
Single application with different UIs depending on the user's role
<p>I will be working on Android application to be used inside an organization.<br> Four different types of users categories will use the application and upon login, each user will see and interact with interfaces depending on his role. </p> <p>I'm familiar with -well- regular Android applications but not with applications that have different UIs and logic depending on the user's role. </p> <p>How to implement this kind of applications? The specification document says it has to be one single application (not four). </p>
java android
[1, 4]
4,601,174
4,601,175
jQuery modal dialog cancel button isn't working
<p>I am using jQuery modal dialog in my web application. I have used one <code>button (cancel)</code> and want to close dialog by clicking on it but it's not working, while <code>disable &amp; destroy</code> is working.<br> any idea please....</p> <p><em><strong>Code :</em></strong></p> <pre><code>$("#dialog-form" ).dialog({ .... buttons: { Cancel: function() { $( this ).dialog( "close" ); // dialog doesn't close // $( this ).dialog( "destroy" ); (it's working) // $( this ).dialog( "disable" ); (it's working) } </code></pre>
javascript jquery
[3, 5]
1,061,030
1,061,031
on click for jquery not being recognized
<p>I have done on hover and on click with jQuery plenty of times, but this is baffling me. I have the jQuery library imported, and I have the following:</p> <pre><code>$(document).ready(function() { $('.content_main_left_bottom').bind("click", function(e) { alert('hi'); }); }); </code></pre> <p>For some reason, it's NEVER reaching the alert!! I even put the alert right above document and it's showing there. I have the div tag with <code>content_main_left_bottom</code> within my code somewhere, is there something else I should do with that class?</p>
javascript jquery
[3, 5]
4,596,951
4,596,952
jQuery - Selecting Multiple Classes
<p>I've had a good look and can't seem to find how to select all elements matching certain classes in one jQuery selector statement such as this:</p> <pre><code>$('.myClass', '.myOtherClass').removeClass('theclass'); </code></pre> <p>Any ideas on how to achieve this? The only other option is to do</p> <pre><code>$('.myClass').removeClass('theclass'); $('.myOtherClass').removeClass('theclass'); </code></pre> <p>But I'm doing it against quite a few so it requires much code.</p>
javascript jquery
[3, 5]
3,282,928
3,282,929
Help With Scalable JavaScript Application Architecture and Chaining
<p>I'm currently trying to roll my own javascript application architecture based off of the recommedations by <a href="http://yuilibrary.com/theater/nicholas-zakas/zakas-architecture/" rel="nofollow">Nick Zakas</a> and I am using jQuery as the base library. I have everything pretty much working but it dawned on me that I have lost the ability to chain methods togeather since you ask the sandbox for methods using the dot notation. Is there a good solution to this? See below for more details.</p> <pre><code>...register module... sandbox.click('p', function(){..}); .... </code></pre> <p>Each module gets an instance of the sandbox which is created when the module is registered. The Class is just a thin piece of code that translates module requests into core actions. </p> <pre><code>Sandbox.prototype = { click : function(el,cb){ return Core.click(el,cb); } } </code></pre> <p>In the core I'm returning a bunch of available methods.</p> <pre><code>... Private members above return { click : function(el, cb){ $(el).click(cb); }, ... more public methods } </code></pre> <p>So currently I have no means of chaining methods together because the accessor will not have any of the other methods I want to chain to it. If anyone has any ideas that would be great.</p>
javascript jquery
[3, 5]
2,677,254
2,677,255
how can i load the contents of an xml file at a url into a string?
<p>how can i load the contents of an xml file at a url into a string?</p> <p>eg there is an xml file at <a href="http://www.example.com/test.xml" rel="nofollow">http://www.example.com/test.xml</a></p> <p>I want the text of the xml to be assigned to a string. How can i do that using c#?</p> <p>thanks</p>
c# asp.net
[0, 9]
3,426,225
3,426,226
How do I prevent the error: System.FormatException: Input string was not in a correct format
<p>My code works just fine as long as the database returns a result set. When it returns nothing it breaks and gives me the following error:</p> <pre><code>System.FormatException: Input string was not in a correct format. </code></pre> <p>Here is my code:</p> <pre><code>DataTable data = GeneralFunctions.GetData( query ); object sumObject; sumObject = data.Compute( "Sum(Minutes_Spent)", "" ); if ( reportType == 1 ) { RepeaterPCBillable.DataSource = data; RepeaterPCBillable.DataBind(); LabelPCBillable.Text = ParseTime( int.Parse( sumObject.ToString() ) ) == null ? ParseTime( int.Parse( sumObject.ToString() ) ) : ""; // ERROR HERE } else { RepeaterDTSTBillable.DataSource = data; RepeaterDTSTBillable.DataBind(); LabelDTSTBillable.Text = ParseTime( int.Parse( sumObject.ToString() ) ) == null ? ParseTime( int.Parse( sumObject.ToString() ) ) : ""; } </code></pre> <p>ParseTime:</p> <pre><code>protected string ParseTime ( int TotalMinutes ) { int hours = TotalMinutes / 60; int minutes = TotalMinutes % 60; if ( hours == 0 ) { return String.Format( "{0} minutes", minutes ); } else if ( hours == 1 ) { return String.Format( "{0} hour and {1} minutes", hours, minutes ); } else if ( hours &gt; 1 ) { return String.Format( "{0} hours and {1} minutes", hours, minutes ); } else { return ""; } } </code></pre>
c# asp.net
[0, 9]
3,070,070
3,070,071
fading between images with attr src
<p>I have the code below,but I don't get the pictures to be fade and replace</p> <p>I see the I'm getting on the firebug console :</p> <p>"missing ) after argument list" and also when I click on the function changeBg the console say that "changeBg is not defined"</p> <pre><code> JS: &lt;script language="JavaScript"&gt; function changeBg (color) {$("#mainimg1).attr("src",Images/"+color+".jpg).fadeIn(3000)}; &lt;/script&gt; HTML &lt;img id="mainimg1" src="Images/black.jpg"&gt; &lt;img src="Images/blue.png" onclick="changeBg(this.name);" name="blue"&gt; &lt;img src="Images/fuksia.png" onclick="changeBg(this.name);" name="fuksia"&gt; &lt;img src="Images/brown.png" onclick="changeBg(this.name);" name="brown"&gt; </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
4,933,855
4,933,856
Need Help With HttpWebRequest object
<p>I'm trying to build a proxy module for .NET, but I'm having trouble copying the Headers from the current request to the new request. I am setting the headers of the new request, because I want the proxy to support SOAP requests. Here is a portion of my code. I can post everything if need, but this is the only part that seems related to the issue I am having:</p> <pre> <code> HttpApplication app = (HttpApplication)sender; // sender from context.BeginRequest event HttpRequest crntReq = app.Request; // set a reference to request object for easier access HttpWebRequest proxyReq = (HttpWebRequest)HttpWebRequest.Create(crntReq.Url.AbsoluteUri); // parse headers from current httpcontext.request.headers and add each name->value to the // new request object foreach (string header in crntReq.Headers) { proxyReq.Headers.Add(header, crntReq.Headers[header]); // throws exception :( } </code> </pre> <p><br /></p> <p>When my code hits the foreach loop, it throws an exception for the Headers.Add function. I'm assuming the collection has access restrictions, for security purposes. It appears that some of the header values are accessible with properties for the HttpWebRequest object itself. However in this case I'd rather get rid of the abstraction and set the properties manually. The exception that I'm receiving is:<br /><i>{"This header must be modified using the appropriate property.\r\nParameter name: name"}</i></p> <p><hr> Thanks in advance for your help,</p> <p>CJAM</p>
c# asp.net
[0, 9]
502,901
502,902
how can i add multiple images to image source in php?
<p>i have multiple Images in drop down List and I have to Show the Selected Images in a Particular box when i click on any image in Drop Down list.after Clicking the image,the previous image should replaced by clicked image in box. but after loading or refreshing the page the updated image disappear and showing the old image which i have given in the source(statically).My Question is how can i change image so that clicked image will show even after loading or refreshing the page. Here is my part of code.</p> <pre><code>&lt;Img Src="photoframes/photo-frame-0000000.Png" alt="" style="position: absolute; left: 0pt; top: 0pt; width: 416px; height: 382px; z-index: 10;" id="frame" height="382" width="416"&gt; </code></pre>
php javascript
[2, 3]
5,922,910
5,922,911
What is the Java equivalent of creating an anonymous object in C#?
<p>In C#, you can do the following:</p> <p><code>var objResult = new { success = result };</code></p> <p>Is there a java equivalent for this?</p>
c# java
[0, 1]
3,233,246
3,233,247
Select first children in nested list using JavaScript
<p>I am trying to select only the first children under Sally. Using JavaScript, how would I select Car, Boat, &amp; Bike and change the font color to red?</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { var j = jQuery.noConflict(); j('#content2 ul li ul').children().css('color', '#ff0000'); }); &lt;/script&gt; &lt;div id="content2"&gt; &lt;div&gt; &lt;div&gt; &lt;ul&gt; &lt;li&gt;Bob&lt;/li&gt; &lt;li&gt;Sally &lt;ul&gt; &lt;li&gt;Car&lt;/li&gt; &lt;li&gt;Boat&lt;/li&gt; &lt;li&gt;Bike &lt;ul&gt; &lt;li&gt;Red&lt;/li&gt; &lt;li&gt;Green&lt;/li&gt; &lt;li&gt;Blue&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;Larry&lt;/li&gt; &lt;li&gt;Mo&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
5,856,690
5,856,691
update progress for ASP:Button
<p>I want to use show a "Loading Image" on the click of server side button, that should be unloaded after the button event completes.</p> <p><a href="http://ajax.net-tutorials.com/controls/updateprogress-control/" rel="nofollow">http://ajax.net-tutorials.com/controls/updateprogress-control/</a> have to use Javascript in this.</p>
javascript jquery asp.net
[3, 5, 9]
4,166,249
4,166,250
$.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]
5,553,471
5,553,472
jQuery autocomplete; want Return key to behave as Tab
<p>The following code behaves different when <strong>tab</strong> and <strong>enter</strong> keys are pressed:</p> <p>--<strong>tab</strong> replaces the text field's value with the value of the selected item and focus goes to the next input box</p> <p>--<strong>enter</strong> replaces the text field's value with the value of the selected item but the focus <em>does not</em> go to the next input box</p> <p>How do I change the behavior of <strong>enter</strong> so that the focus goes to the next input box?</p> <pre><code>$('input').autocomplete({ autoFocus: true, source: ["test","some text"], delay: 0 }); </code></pre> <p>I have tried to add the following line:</p> <pre><code>select: function(event, ui) { if (event.keyCode == 13) { trigger({ type : 'keypress', which : 9 }); } } </code></pre> <p>This doesn't work. See <a href="http://jsfiddle.net/YbPVX/4/" rel="nofollow">http://jsfiddle.net/YbPVX/4/</a></p>
javascript jquery
[3, 5]
199,700
199,701
jQuery attribute selector unrecognized expression error
<p>I'm using the following code to select the list item for current page from a navigation unordered list, but I keep getting an unrecognized expression error on <code>'a[href$="{server-relative URL}"]'</code></p> <p>I've checked matching quotes/brackets that other questions mention, and the link will not contain characters beyond the usual <code>/ &amp; ? %</code> The code I'm using is:</p> <pre><code>$(document).ready(function() { var pathname = window.location.pathname; var selector = "'a[href$=\"" + pathname + "\"]'"; var listItem = $(selector).parent().parent(); listItem.addClass('selected'); }); </code></pre> <p>I'm using jQuery 1.8.2 (latest version). Thanks!</p>
javascript jquery
[3, 5]
2,503,256
2,503,257
Wrapping string in tags
<p>I want to take a string and wrap it in tags like this:</p> <pre><code>&lt;!-- What I've got: --&gt; &lt;div class="calendar"&gt;Feb 22&lt;/div&gt; &lt;!-- What I want: &lt;div class="calendar"&gt; &lt;div class="calendarMonth"&gt;Feb&lt;/div&gt; &lt;div class="calendarDay"&gt;22&lt;/div&gt; &lt;/div&gt; --&gt;​ </code></pre> <p>I tried to cook some jQuery, but I'm kind of stuck:</p> <pre><code>var calendarText = $(".calendar").html(); var calendarArray = calendarText.split(" "); var calendarMonth = calendarArray[0]; var calendarDay = calendarArray[1]; /* Then I tried something like this: calendarMonth.wrap("div").addClass("calendarMonth"); But I guess calendarMonth is just a string, not an object. */ </code></pre> <p>​How would you go about something like this? Any ideas is highly appreciated.</p> <p>JSFiddle example here: <a href="http://jsfiddle.net/timkl/u23wY/" rel="nofollow">http://jsfiddle.net/timkl/u23wY/</a></p>
javascript jquery
[3, 5]
1,808,135
1,808,136
Jquery Timer To server time
<p>I am creating a game where i need the user to enter a deadline time using a jquery dateTime plugin (my PC time) and i save it in the database along with the current time using php (server time).. Then i run a cron (on the server time) where i need the difference of these two times for further work. but there is a logical error here.</p> <p>I checked and the difference between the times was of 10 hours and 3 mins. so i adjusted that but this will give a logical error if it is used from some other place,, as teh jquery will pick up their PC time and php will pick the sever time.</p> <p>what should i do?</p>
php jquery
[2, 5]
5,629,181
5,629,182
fadeout and fadein between two different pages in jquery
<p>Apologies if this may sounds simple, all im trying to do is fadeout the current page and fadein another page. However I'm having difficulties. I know how to do it between divs, the following fades out the leftcolumn div and inputs this in together with the myform on the stage3.php page. My question is how do i fadeout stage2.php and fadein stage3.php?</p> <pre><code>$("#leftcolumng").fadeOut(500, function(){ $("#leftcolumng").load('stage3.php #myform', function () { $(this).fadeIn(50); </code></pre> <p>});</p>
javascript jquery
[3, 5]
553,640
553,641
How to take the value of two EditText fields and perform simple mathematics
<p>I am new to Android development and am working on a simple practice project where the user enters a number into two EditText fields and presses a Button labeled "Calculate" and the sum of the two numbers is displayed. Here is the code I have so far, but I don't know how to add the two string values and output it to a TextView field named "answer": </p> <pre><code>public void calNumbers(View view) { EditText text = (EditText)findViewById(R.id.edit_number1); String value = text.getText().toString(); EditText text2 = (EditText)findViewById(R.id.edit_number2); String value2 = text2.getText().toString(); TextView answer = (TextView) findViewById(R.id.answer); } </code></pre>
java android
[1, 4]
1,601,755
1,601,756
how to change the alterbox and confirm box buttons and Icons in asp.net2.0?
<p>I am writting like that in asp.net2.0 .cs file , after executing code disply alert message 'Invoice Created Successfully' but warning icon displayed in that message but it display information icon and same as confirm box also pls help me</p> <pre><code>Response.Write("&lt;script&gt;alert('Invoice Created Successfully');&lt;/script&gt;"); </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
4,659,796
4,659,797
Android Limit EditText to Integer input only
<p>I am trying to apply some kind of verification to an edittext. A user should only be able to enter integers between 1 and 60. I am wondering whether I should let them type whatever they like and when they focus off of the edittext check the contents and if it is out of bounds change the value to a default, say 0.</p> <p>Or is there a way to limit the keyboard to only allow integers?</p> <p>UPDATE: I am doing everything programmatically. So far I have been able to limit to only numeric input and have a maximum of 2 characters by implementing the following. I am still struggling to limit only values between 0 and 60 though.</p> <pre><code> editText.setInputType( InputType.TYPE_CLASS_NUMBER ); InputFilter[] FilterArray = new InputFilter[1]; FilterArray[0] = new InputFilter.LengthFilter(2); editText.setFilters(FilterArray); </code></pre>
java android
[1, 4]
1,576,601
1,576,602
How to save original height of a series of boxes when height is unkown?
<p>I have a series of boxes:</p> <pre><code>&lt;div class="box"&gt;&lt;/div&gt; &lt;div class="box"&gt;&lt;/div&gt; &lt;div class="box"&gt;&lt;/div&gt; &lt;div class="box"&gt;&lt;/div&gt; </code></pre> <p>The css:</p> <pre><code>.box { height: auto; } </code></pre> <p>The actual height is set only once the boxes are loaded with content, therefore I don't know their height at start. </p> <pre><code>$(".box").each(function(){ boxHeight = $(this).height(); }); </code></pre> <p>Bu that's wrong, basically I need to save those heights and be able to reuse them later on</p>
javascript jquery
[3, 5]
3,097,337
3,097,338
How to Display a Status Message on the Next Page after a Redirect with .net Framework?
<p>I am adding a form to my .net web forms application and I want to redirect the user to another page but display a status message after the redirect such as 'Your articles has been submitted successfully'.</p> <p>Any good ways of doing this?</p> <p>I was thinking of doing it with sessions and a user control but wanted to see if there is an easier way.</p> <p>Thought about code like this:</p> <p>User control codebehind:</p> <pre><code> public String SessionName { get; set; } public String Message { get { if (Session[SessionName] == null) return String.Empty; return Session[SessionName].ToString(); } } protected void Page_Unload(object sender, EventArgs e) { Session[SessionName] = null; } </code></pre> <p>User control markup:</p> <pre><code>&lt;% if (!String.IsNullOrEmpty(Message)) {%&gt; &lt;div&gt; &lt;%= Message %&gt; &lt;/div&gt; &lt;%} %&gt; </code></pre>
c# asp.net
[0, 9]
808,187
808,188
c# equivalent for php @
<p>I need an equivalent of "@" in php for c#. here is example i want to do:</p> <pre> <code> //in php $str = @$_POST['x'].@$_POST['y']; //in c# string str = Request["x"]+Request["y"]; //if the given key is not exist it will break the code. //also i dont want to use "try catch" because variables is many. </code> </pre>
c# php
[0, 2]
3,102,360
3,102,361
Error while creating chart using c# asp.net
<p>Hi this my first time I'm trying to create a chart and I have an error, so can any one help me please ? </p> <p>This is the code ( I'm using line chart ) : </p> <pre><code>protected void Page_Load(object sender, EventArgs e) { Chart1.ChartAreas.Add("chtAres"); Chart1.ChartAreas[0].AxisX.Title = "Category Name"; Chart1.ChartAreas[0].AxisX.TitleFont = new System.Drawing.Font("Verdana", 11, System.Drawing.FontStyle.Bold); Chart1.ChartAreas[0].AxisY.Title = "UnitPrice"; Chart1.ChartAreas[0].AxisY.TitleFont = new System.Drawing.Font("Verdana", 11, System.Drawing.FontStyle.Bold); Chart1.ChartAreas[0].BorderDashStyle = ChartDashStyle.Solid; Chart1.ChartAreas[0].BorderWidth = 2; Chart1.Legends.Add("UnitPrice"); Chart1.Series.Add("UnitPrice"); Chart1.Series[0].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Line; Chart1.Series[0].Points.DataBindXY(result.DefaultView, "CategoryName", result.DefaultView, "UnitPrice"); } } </code></pre> <p>and this is the Error Source Error: </p> <blockquote> <p>Line 1: &lt;%@ Application Codebehind="Global.asax.cs" Inherits="WebApplication3.Global" Language="C#" %></p> </blockquote>
c# asp.net
[0, 9]
5,000,394
5,000,395
Replace text using jquery
<p>Hi I need to replace a text within div that says "Please wait..." with "Ok.Its done." after a random delay.Please help.Thanks in advance.</p>
javascript jquery
[3, 5]
2,510,898
2,510,899
Need to generate ASP.NET controls from a database
<p>I am writing an application where the controls for a page need to be determined from data in a Sql Server table.</p> <p>For example: I have a PropertyGroups with Properties(Join Table) I then have categories to Propertygroups, the Properties have a values table, blah blah. Not to get too much in to the DB schema, but I need to assign controls to properties.</p> <p>Like lets's say that property Color needs to be a listbox and the items collection is predetermined by the data in the database etc... </p> <p>What is the most efficient way to render this before the page is loaded? A handler maybe? I am using Master Pages as well.</p>
c# asp.net
[0, 9]
3,580,719
3,580,720
how to play and stop sound control by javascript in wmplayer?
<p>how to play and stop sound control by javascript in wmplayer in asp.net ?</p>
asp.net javascript
[9, 3]
420,549
420,550
Can't add new lines in JavaScript alert Box?
<p>I'm generating a string in PHP and then eventually passing this string into a Javascript alert box, my problem is I actually can't add line breaks in my alert box.</p> <p>My code looks as follows</p> <pre><code>$str = "This is a string\n"; $alert = $str."This is the second line"; if(!empty($alert)){ ?&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { alert('&lt;?=$alert?&gt;'); }); &lt;/script&gt; &lt;?php } </code></pre> <p>I'm getting the error</p> <p>Undeterminnated string literal</p> <p>If I remove the \n from string it works 100% but without line breaks</p>
php javascript
[2, 3]
5,653,997
5,653,998
Is adding custom attributes using jquery metadata plugin cross browser?
<p>Imagine I have some make-believe markup containing a list of books with custom attributes using the <a href="http://plugins.jquery.com/project/metadata" rel="nofollow">metadata plugin</a>.</p> <pre><code>&lt;div&gt; Haruki Murakami &lt;/div&gt; &lt;div&gt; &lt;ul&gt; &lt;li&gt;&lt;span id="book5" data="{year: 2011}"&gt;1Q84&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span id="book7" data="{year: 1980}"&gt;Norwegian Wood&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span id="book9" data="{year: 2000}"&gt;Hard Boiled Wonderland&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>Is this cross browser, meaning working for all browsers (including IE6) ? By working, I mean I don't want the attribute to disappear.</p>
javascript jquery
[3, 5]
3,530,887
3,530,888
Querying MySQL tables and displaying results in tabbed-panes
<p>I have an PHP array. I have to loop over it to query 3 MySQL tables. The attributes of all the tables are the same, just the table names are different. </p> <p>Once I get the results I have to display it in tabbed-panes. I will have 3 tabbed-panes. When I click on the tab, respective results should populate the table.</p> <p>How can I go about retrieving and displaying this?</p>
php javascript
[2, 3]
4,586,299
4,586,300
Only Cyrillic input text form
<p>How do I restrict input text into a web form textbox only <strong>Cyrillic</strong> characters?</p>
javascript jquery
[3, 5]
1,203,000
1,203,001
How to show a html button for asp:button click
<p>I have an asp.net web page with asp:button control. I need to show two (normal) HTML buttons for the click event of the asp:button control. My requirement is when the page load for the first time there will be only asp:button there visible. After I click on that asp:button other two HTML buttons should be visible. But they should be visible for all the other postbacks. I mean if there would be any post backs, that HTML buttons should be visible constantly. How could I do that? Please help me. I tried to implement that using jquery hide and show.</p>
c# jquery asp.net
[0, 5, 9]
2,325,117
2,325,118
Checkbox problems inside jQuery dialog and Repeater
<p>So I've been basically beating my head against the wall on this for a while now. Excuse me if I throw up too much code here, don't know a better way to explain it. I've got a Repeater with an ItemTemplate of:</p> <pre><code>&lt;ItemTemplate&gt; &lt;div id='FileFrame&lt;%#Eval("Id")%&gt;' class="view"&gt; &lt;userControl:ConfigFiles ID=&lt;%#Eval("Id")%&gt; runat="server" /&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; </code></pre> <p>Some jQuery that sets up the dialog box for the div.</p> <pre><code>$(document).ready(function() { $(".view").dialog({ autoOpen: false, title: "Configuration Files", buttons: {}, height: 600, width: 800, open: function (type, data) { $(this).parent().appendTo("form"); } }); }); </code></pre> <p>and some more jQuery that opens the dialog.</p> <pre><code>$("#FileFrame"+ConfigId).dialog('open'); </code></pre> <p>Now the User Control has a bunch of checkboxes inside of it inside other repeaters along with a "Download Checked Boxes" button. The problem is that when I go through debugging and click the button, none of the checkboxes are ever read as checked unless I initially set the Checked="true" on the aspx page.</p> <p>Here's the a snippet from the code behind where it's failing to do what I thought it should do.</p> <pre><code>foreach (RepeaterItem item in FilesRepeater.Items) { CheckBox box = item.FindControl("DownloadFileCheckBox") as CheckBox; if (box.Checked) //&lt;-- always false unless I set it to true in aspx, // then it's always true {/*do work here*/} } </code></pre> <p>Any suggestions?</p>
c# jquery asp.net
[0, 5, 9]
2,143,536
2,143,537
How to find out where variable is being set?
<p>I have a page and there is a public variable that is being set somewhere, but I can't find where it is being set. I have tried using 'Find Usages' but it only finds where it used within the same page.</p> <p>Are there any other ways I can find out where it is being set?</p>
c# asp.net
[0, 9]
1,096,721
1,096,722
Avoid repetition by passing in a value
<p>I'm inserting images into dom with javascript and I would like to pass in the second classname and some other properties of the images while calling the function.</p> <p>So I have functions containing code this:</p> <pre><code>function movieCreator(movieName){ '&lt;img class="clip terminator" src="images/terminator.png" onclick="imageControl(this);" alt="terminator" /&gt;',' }; function movieCreator(movieName){ '&lt;img class="clip rambo" src="images/rambo.png" onclick="imageControl(this);" alt="rambo" /&gt;' }; </code></pre> <p>There is some other stuff inside those functions too but I'm trying to simplify the question a bit. I would like to pass in the words "terminator" and "rambo" while calling the functions like</p> <pre><code>movieCreator(terminator); movieCreator(rambo); </code></pre> <p>but my head gets really stuck while I try to think where to place the quotes and things like that in order to replace those words correctly from the code.</p> <p>So my question is this: what would be the correct syntax of replacing the word "terminator" with a dynamical value that is passed in when the function is called?</p>
javascript jquery
[3, 5]
3,948,677
3,948,678
how can I store a newly appended element into a variable?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1162677/how-can-i-get-a-reference-to-a-node-directly-after-it-is-appended">How can I get a reference to a node directly after it is appended?</a> </p> </blockquote> <p>as an example:</p> <pre><code>$(document).append('&lt;div class="new-elem" /&gt;'); </code></pre> <p>how do i now store the above newly created element into a variable so i can use it like this:</p> <pre><code>newElem.append('div class="another-new-element" /&gt;'); </code></pre> <p>where newElem is the element i appended to the document initially?</p> <p>i'm assuming it can't be done like:</p> <pre><code>var newElem = $(document).append('&lt;div class="new-elem" /&gt;'); </code></pre>
javascript jquery
[3, 5]
5,029,242
5,029,243
jQuery fadeOut / fadeIn scroll issue in Chrome
<p>I am using jQuery fadeOut &amp; fadeIn to dynamically change the content on a page, inside a div. All browsers work great, except Chrome for Mac. In Chrome for Mac, on the first page, if you scroll down, fadeOut and then fadeIn the newly faded in content is "off the screen" - in other words, missing. If you don't scroll down on the first page, and go to the second page, the content is displayed just fine.</p> <p>I have created a simple demo on my site. Again, this works in every browser but Chrome for Mac. Please help! Chrome for Windows works fine.</p> <p>Demo: <a href="http://dev.corecoding.com/problem.php" rel="nofollow">http://dev.corecoding.com/problem.php</a></p> <p>On the Mac, I am seeing a user agent with AppleWebKit/534.57.2, and in Windows it uses AppleWebKit/536.5. The interesting bit is that it works fine in Safari for Mac, which uses the same (older) WebKit.</p> <p>Is there a way to make this work with another jQuery / javascript commands? Or should I just forget about it and wait for Chrome's WebKit to be updated?</p>
javascript jquery
[3, 5]
5,932,634
5,932,635
Farbtastic jQuery Color Picker Callback Issues
<p>I'm trying to play around with the Farbtastic: <a href="http://acko.net/dev/farbtastic" rel="nofollow">http://acko.net/dev/farbtastic</a> color picker plugin but I'm having some issues.</p> <p>I want to setup a callback function so that I can change the bg color like so:</p> <pre><code> $('#picker').farbtastic(function(){ $("body").css("background-color",$.farbtastic('#picker').color); }); </code></pre> <p>This works fine, but by doing this, the input field no longer updates the hex value in real time.</p> <p>How can I make it so the hex value within the input field AND the body background color update both at the same time?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,797,887
1,797,888
Compare journey date with return date in asp.net c#
<p>I have to compare Journey date with return date. Return date should be Greater than equal to journey date. Which validator should be used for that &amp; how? Help me. Asp.net c#. Thank you.</p>
c# asp.net
[0, 9]
2,695,104
2,695,105
How to send an Email with longitude and latitude coordinates or maybe send a Google static map using c#
<p>How to send an Email with longitude and latitude coordinates or maybe send a Google static map using c#. The information should represent the sender email address or IP address as to where the sender is located. </p> <p>I am using a simple email form and would like to add this feature to it. How do I go about this ? I am open to any suggestions or different ways of achieving this.</p>
c# asp.net
[0, 9]
3,116,670
3,116,671
How to use live method with zclip plugin?
<p>How to use live method with this -> <a href="http://www.steamdev.com/zclip/" rel="nofollow">http://www.steamdev.com/zclip/</a></p> <p>Edit:</p> <pre><code>$(document).ready(function(){ $('a#copy-description').zclip({ path:'js/ZeroClipboard.swf', copy:$('p#description').text() }); </code></pre> <p>i need to use live method cuz <code>a#copy-description</code> will be generate via javascript.</p>
javascript jquery
[3, 5]
3,980,253
3,980,254
Ignore escape sequences in strings java?
<p>In C#, I can write the string <code>"\\myDir\\myFile"</code> as <code>@"\myDir\myFile"</code>. What is the equivalent for this "@" character in Java, if any?</p>
c# java
[0, 1]
4,765,939
4,765,940
Setting a dynamic margin
<p>So I have this issue with setting a margin that dynamical decreases and increases to a minimum of 8px and maximum of 40px.</p> <p>The margin is being set between 11 different blocks which are inside a container. The container can be a minimum width of 960px or a maximum of 1280px and always has a fixed height.</p> <p>How can I make it so that the space (margin-left) in between the boxes always stretches to fill the container correctly?</p> <p>Below is an image of what I am aiming for at 960px width</p> <p><img src="http://i.stack.imgur.com/61K2X.png" alt="960px width container"></p> <p>Now an an image of it at it's full width of 1280px</p> <p><img src="http://i.stack.imgur.com/vB9nT.png" alt="1280px width container"></p> <p>As you can see from the images all im trying to do is separate the boxes as the resolution is changed.</p> <p>I currently have something like this using jQuery</p> <pre><code>$(window).bind('resize', function(){ var barWidth = $(".topBar").width(); $(".barModules li").css('margin-left', my dynamic value here)); }); </code></pre> <p>I'm stuck on how I should be calculating this and if that's even the right way to go about it :/</p> <p>An example of what I have so far: <a href="http://jsfiddle.net/m4rGp/" rel="nofollow">http://jsfiddle.net/m4rGp/</a></p>
javascript jquery
[3, 5]
1,329,853
1,329,854
Jquery Theme Reload
<p>I've changed my jquery theme but when I try to open website into my browser then it loads old theme. I have checked with CTRL + R, CTRL + F5 and also restarted browser. Its loading old theme again. I've also tried with CHROMe but same problem. But When I open this website on another computer where I haven't opened it before then it loads new theme. I've tried to add following meta tags but not succeeded. Any advice please.</p> <pre><code>&lt;META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"&gt; &lt;META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"&gt; &lt;META HTTP-EQUIV="expires" CONTENT="0"&gt; </code></pre> <p>Thanks in Advance.</p>
php javascript jquery
[2, 3, 5]
3,989,794
3,989,795
Equivalent to PHP function number_format in jquery/javascript
<p>PHP Function:</p> <pre><code>function formatNumberForDisplay($number, $decimal=0, $decimalSeperator='.', $numberSeperator=',') { return number_format($number, $decimal, $decimalSeperator, $numberSeperator); } </code></pre> <p>My need: Can any body suggest me the equivalent functionality in jquery/javascript. </p> <p>Thanks in advance.</p>
php javascript jquery
[2, 3, 5]
5,957,994
5,957,995
how to get data from web to android app ?
<p>I'm android beginner. I'm programming stock market application for android.<br> I don't know any way to do that, what should I do to get data about stock market?<br> Thanks very very much!!!</p>
android asp.net
[4, 9]
1,434,507
1,434,508
Opening a specific node in an asp.net tree view dynamically
<p>Can any one help to expand a particular node according the value passed from a previous page..i.e:</p> <p>Page1: Value to pass : hyp1</p> <p>Page 2: Tree View--> if (val == hyp1) then</p> <p>SubNode in a node2 should open....</p> <p>Can any one help me in doin this using C# in asp.net?</p>
c# asp.net
[0, 9]
3,073,077
3,073,078
provide software as a service just like google docs
<p>I want to view file on my client machine through web browser which is uploaded on server...without client having that file and software to open it...in short to give software as a serrvice to my clients just like google docs.I have done uploading of file to server..not getting further part of viewing my file on browser...My code is done in asp.net c# with visual studio 2008.</p>
c# asp.net
[0, 9]
468,202
468,203
Javascript: How can I make that if the user check a checkbox then all nested checkbox are selected too?
<p>Let say I have this:</p> <pre><code>&lt;input id="album" name="album" type="checkbox" value="1" /&gt; &lt;label for="album"&gt;Albums&lt;/label&gt;&lt;br&gt; &lt;ul&gt; &lt;li&gt; &lt;input id="albums_155596787784467" name="albums[155596787784467]" type="checkbox" value="1" /&gt; &lt;label for="albums_155596787784467"&gt;Profile Pictures&lt;/label&gt;&lt;br&gt; &lt;/li&gt; &lt;li&gt; &lt;input id="albums_100358313308315" name="albums[100358313308315]" type="checkbox" value="1" /&gt; &lt;label for="albums_100358313308315"&gt;Perfil&lt;/label&gt;&lt;br&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>When the user check the first checkbox I want that all checkboxes in the ul to be checked too.</p> <p>Also, if any of the checkboxes inside the ul is set to not checked, then the first checkbox should be set to not checked too.</p> <p>I use JQuery.</p> <p>Edit:</p> <p>Also, if all checkboxes inside the <code>ul</code>are checked, then the first checkbox should be checked too.</p>
javascript jquery
[3, 5]
538,774
538,775
difference between XMLHttpRequest and $ajax
<p>Hello I have read about jQuery ajax method, jQuery wraps some XMLHttpRequest inside. I need(want) to redo next stuff to $ajax, but i wearied about parameters, is it possieble send to $ajax url with parameters with out param key just in URL param ?</p> <pre><code>var element ; ... if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE http_request = new ActiveXObject("Microsoft.XMLHTTP"); } http_request.onreadystatechange = function() { alertContents(element); }; url = unescape(url + parameters); http_request.open('GET', url, true); http_request.send(null); </code></pre>
javascript jquery
[3, 5]
5,880,234
5,880,235
Get selected value from select list
<p>I have this part here, which i use in order to print some values in a list:</p> <pre><code>&lt;select id = "paisja" name="paisja" &gt; &lt;?php while( $row = odbc_fetch_array($resultpaisja) ) { ?&gt; &lt;option value="&lt;?php echo $row['id_paisje']; ?&gt;"&gt;&lt;?php echo $row['paisje']; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; </code></pre> <p>Now, what i need is if i print the list of this order, the list should appear again but with the selected value... Some Help Please? Thanks</p>
php javascript jquery
[2, 3, 5]
1,871,704
1,871,705
Common base class for usercontrols and pages in ASP.NET
<p>Right now I have a base class for my pages which inherits <code>System.Web.UI.Page</code> and another base class for my usercontrols which inherits <code>System.Web.UI.UserControl</code>, these classes contains the same methods. Since C# doesn't support multiple inheritance I can't combine the two classes into one that inherits both Page and UserControl. </p> <p>What would be the best way to keep the functionality in the two base classes but have the implementation of these methods in only one place?</p> <p>I'm thinking of making a interface and let the two base classes call a third class that contains the implementation of the interface. Is there any better way so that when I add a new method I don't have to do it in three places (even though the implementation is only in the third class).</p>
c# asp.net
[0, 9]
3,564,925
3,564,926
Display url in text box
<p>I have a textbox as follows:</p> <pre><code>&lt;asp:TextBox runat="server" ID="txtOtherApps" Height="400" Width="400" TextMode="MultiLine" ontextchanged="txtOtherApps_TextChanged" &gt;&lt;/asp:TextBox&gt; </code></pre> <p>How to display link in this textbox?</p>
c# asp.net
[0, 9]
3,364,947
3,364,948
Rewrite code so that filter is mutually inclusive rather than exclusive jquery/js
<p>I'd like to make multiple filters inclusive not exclusive. Please see this demo: <a href="http://codeblog.cz/pitch/portfolio_thumbnails_a.html" rel="nofollow">http://codeblog.cz/pitch/portfolio_thumbnails_a.html</a></p> <p>Look at the sidebar, there is a cool filter, you click radio button and only items with <code>data-category="filter_name,second_filter_name"</code> remain.</p> <p>I'd like to create several filters of this sort.</p> <p>Something like in the mockup: <img src="http://i.stack.imgur.com/3TvDi.png" alt="enter image description here"></p> <p>I'm thinking several ways to do this. First I tried to make radio into checkboxes, but it didn't work. Checkboxes work same way as radio buttons, obviously jquery is working here...</p> <p>I believe this part of page.js is responsible for filter:</p> <pre><code>/** * Toggle items by category(attribute data-category, multiple categories must separed by comma) * * @param {String|Object} items Items to filter * @param {String} category Category */ utils.filter = function(items, category) { var $items = $(items); if (category == 'all') $items.show(); else $items.each(function() { var $item = $(this); var categories = $item.attr('data-category').split(','); $item.toggle($.inArray(category, categories) != -1); }); }; </code></pre> <p>To be more clear what I want to achieve, I'd like each filter section to work inclusively. For example if I select Action, and 2010 in second filter, I want to see posts that have both this tags.</p> <p>Any ideas?</p>
javascript jquery
[3, 5]
4,814,875
4,814,876
pass "calendar.selectedvalue" in querystring from gridview
<p>I wanted to pass "calendar1.Selecteddate" in a query string from gridview in one page to another gridview (I have written sqlquery in that gridview) in another page. As seen in the below code I tried passing it but this did not work. Can anyone tell me how to pass the selected date from calendar in query string</p> <pre><code> &lt;asp:HyperLinkField DataNavigateUrlFields="LocalIP" DataNavigateUrlFormatString="DailyResults.aspx? Terms={0}&amp;column=LocalIP&amp; startdate=Calendar1.SelectedDate.Date.Date.ToShortDateString() DataTextField="LocalIP" HeaderText="User" /&gt; </code></pre>
c# asp.net
[0, 9]
3,785,528
3,785,529
Anonymous Overriding HashSet hashCode
<p>I'm trying to use a <code>HashSet</code> to remove the duplicates from a list of <code>ApplicationInfo</code> objects and I'm trying to use more advanced ways to accomplish this than the good old loop and compare.</p> <p>I've been recently learning about the anonymous abilities in Java and I'm trying to apply that here but I'm stuck. From what I understand, <code>equals()</code> simply uses the <code>hashCode()</code> method to determine equality and from what I could gather I would only need to override the <code>hashCode()</code> method.</p> <p>Within the <code>ApplicationInfo</code> object is a field called <code>packageName</code>, a string, which is the ONLY field I want the <code>HashSet</code> to compare and exclude any duplicates.</p> <p>Since I'm new to Java, I'd love some help understanding if I'm understanding this right and either way, how to do this. I realize I could extend <code>HashSet</code> and do it that way but I want to try this Anonymous deal so I learn something.</p> <p>If I have a HashSet containing ApplicationInfo objects, how do I return a hashCode based on the packageName field?</p> <pre><code>//Help me fix the below idea please HashSet&lt;ApplicationInfo&gt; hs = new HashSet&lt;ApplicationInfo&gt;() { @Override public int hashCode() { // How do I do this sort of thing return this.packageName.hashCode(); } }; </code></pre>
java android
[1, 4]
284,821
284,822
Holding Information in Android App
<p>I've only just started to write in Java on Android, so please bear with me.</p> <p>I have some settings I want to hold in my app, normally I would have used an xml file. Trouble is i'm not sure how to load it into the xml parser to read it. </p> <p>I thought I might be able to drop it into /res/values/Info.xml and open it from there but it does'nt find the file.</p> <p>I have also read that people are starting to use a SQLite database to hold information in, is this more the standard way to go?</p> <p>thanks a lot</p> <p>Luke </p>
java android
[1, 4]
2,964,808
2,964,809
jQuery vs. javascript?
<p>I recently stumbled upon some javascript forums (sadly, link is lost somewhere in the universe), where you could feel real hate against jQuery for not being... any good?</p> <p>Most arguments seem to make sense actually.</p> <p>Now, I really like jQuery, mostly for letting me concentrate on things I want to do rather on browser inconsistencies and it actually makes AJAXing with cool (or <em>overused</em>?) effects fun.</p> <p>But if really is something rotten in the core of jQuery, I don't want to rely on it the way I actually... rely on it.</p> <p>I don't want to start yet another argument over which framework is the best... but... Which framework is the best <em>(joke)</em>? As a case usage, think about small to medium web and it's administration.</p> <p>I'm just trying to figure out, if stuff in <em>some</em> framework or pure javascript with few mine functions really makes difference.</p> <h2>Edit:</h2> <p>I actually tried to had a normal objective discusssion over pros and cons of 1., using framework over pure javascript and 2., jquery vs. others, since jQuery seems to be easiest to work with with quickest learning curve. However, some people just don't understand it and think that I'm starting yet another flame (what I am not). I am actually voting to reopen this question.</p> <p>Also I'm really interested in:</p> <ul> <li>Does jQuery heavily rely on browser sniffing? Could be that potential problem in future? Why?</li> <li>I found plenty JS-selector engines, are there any AJAX and FX libraries?</li> <li>Is there any reason (besides browser sniffing and personal "hate" against John Resig) why jQuery is wrong?</li> </ul> <p>jQuery actually, as most used, stands for other frameworks also.</p>
javascript jquery
[3, 5]
1,153,416
1,153,417
Parsing a date in long format from ATOM feed
<p>I get this date in javascript from an rss-feed (atom):</p> <pre><code>2009-09-02T07:35:00+00:00 </code></pre> <p>If I try Date.parse on it, I get NaN.</p> <p>How can I parse this into a date, so that I can do date-stuff to it?</p>
javascript jquery
[3, 5]
2,944,276
2,944,277
Should, in a web app using a 3-tier design pattern, one of the bottom layers provide some checking mechanism to ensure…?
<p>I’m trying to write a web app using 4-tier design pattern ( Data Store, DAL, BLL and UI). Among other things this app would also implement a forum. </p> <p>Suppose I want to move a thread from one forum to another. In order to do this, UI layer must pass down to other layers the ID of a thread and the ID of a forum to which I wish to move this thread ( UI would pass these parameters by calling method A in BLL layer and A would in turn call method B in DAL layer… ). </p> <p>a) Now should one of the bottom layers provide some sort of checking mechanism to ensure that the two ID arguments supplied by UI layer really represent an existing thread and an existing forum or is it the responsibility of UI layer to provide valid ID values? </p> <p>thanx</p> <p><br></p> <p>EDIT:</p> <blockquote> <p>I would consider the ability to pass invalid IDs a bug.</p> </blockquote> <p>Should non existing ID be considered a bug just in the case of moving a thread, or also in the case of displaying a thread. Thus when user navigates to page Showthread.aspx?ID={0}, if query string parameter ID references non existing ID, If none of the layers check for the validity of ID, then GridView simply won’t display any </p> <blockquote> <p>“But in this case it doesn't look like the ids are in any sort of list. If they were one could only assume that this would never happen as I assume the lists would be populated by a stored procedure or a DAL procedure that pulls all valid IDs.”</p> </blockquote> <p>But even if user chooses IDs from a set of list, by the time it posts the page back, the DB table containing this ID could be changed in the mean time by admin or whomever?! </p>
c# asp.net
[0, 9]
399,473
399,474
I need some form of BMI Calculator
<p>I need to develop some form of BMI calculator for part of a medical site I am working on.</p> <p>In Javascript preferably.</p> <p>Anyone? </p>
php javascript
[2, 3]
5,645,825
5,645,826
jQuery multiple conditions within if statement
<p>What is the syntax for this loop to skip over certain keys? The way I have it written is not working properly.</p> <pre><code> $.each(element, function(i, element_detail){ if (!(i == 'InvKey' &amp;&amp; i == 'PostDate')) { var detail = element_detail + '&amp;nbsp;'; $('#showdata').append('&lt;div class="field"&gt;' + i + detail + '&lt;/div&gt;'); } }); </code></pre>
javascript jquery
[3, 5]
1,785,392
1,785,393
how to bring drag and drop operations for controls in runtime?
<p>For example i've developed a website which contains some controls like button,treeview,etc....Then how can i drag and drop those controls....while running that application....</p>
c# asp.net
[0, 9]
5,620,353
5,620,354
Disable page scroll until page loads - JQuery
<p>I have built a parallax scrolling intro for a clients website - the site contains many high res images - so I have created a quick loader which blanks out the screen with a full screen high z-index div and then uses the setTimeout method to fade in the page 4 seconds after document ready (not sure if this is the best way to do this but it works in every test I've tried).</p> <p>I would like to disable the scroll to prevent users scrolling through the animation before it appears -can anyone recommend a good cross-browser method to do this? </p>
javascript jquery
[3, 5]
1,985,551
1,985,552
an android app code
<p>string comparison not working.it is going to the next activity even if password does not match neeed help.Code is pasted below</p> <pre><code>if(m.equals(w)) { Toast.makeText(getApplication(), "done", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(); intent.setClass(v.getContext(),Mysubactivity.class); startActivity(intent); } </code></pre> <p>I have declared m and w as two strings and assigned them to edittext using <code>String m = et.getText.toString();</code></p>
java android
[1, 4]
5,233,625
5,233,626
Checking to see what item is selected in an HTML select list via jQuery
<p>How do I get the actual value (or text) of the item selected in an HTML select box? Here are the main methods I've tried...</p> <pre><code> document.getElementById('PlaceNames').value </code></pre> <pre><code> $("#PlaceNames option:selected").val() </code></pre> <pre><code> $("#PlaceNames option:selected").text() </code></pre> <p>And I've tried various variations on these. All I ultimately want to do is get that data and send it to a web service via AJAX, I just need the string representation of what the user selected. This seems like it should be really easy and I've even found a question similar to this here, but I'm still having issues getting it worked out. Google doesn't seem to be helping either. I feel like it must be due to some fundamental misunderstanding of Javascript and jQuery. </p> <p>EDIT: I should mention that I'm using IE7</p>
javascript jquery
[3, 5]
1,070,298
1,070,299
Dynamically created divs get hidden after postback
<p>I have several divs in a nested gridview which are bound to att runtime with the command div id="div&lt;%# Eval("id") %>". I then set the visibilty of the div via javascript. The problem is that the visibilty setting isnt retained between postbacks. (Im using a filter feature that filters the rows in the nested gridview). </p> <p>How can I retain the visibilty settings for all the divs created dynamically? (Could be up to fifty divs.)</p>
c# asp.net
[0, 9]
1,303,851
1,303,852
Add predefined function to onclick with jQuery
<p>This might be a little confusing. I'm creating this slider thing. When a slide is displayed, its onclick == "", and if it is hidden, onclick == "slide(#)" where # is the number of the slide. When you select a number to slide to, the current slide slides out, and the next slide comes in. During that, the onclick for the slide going out is suppose to == "slide(#)", and the onclick for the slide coming in is suppose to == "". My problem is reattaching the slide() to the onclick for the slide going out.</p> <p>Here is my code so you can see everything that is going on: <a href="http://chigstuff.com/header/" rel="nofollow">http://chigstuff.com/header/</a></p> <p>Hopefully you can understand what I'm talking about. Thanks!</p>
javascript jquery
[3, 5]
4,888,438
4,888,439
jQuery .add method seemingly not working?
<p>I wonder if anyone can explain this:</p> <pre><code>$(document).ready(function() { var popup = $('&lt;div id="popup"&gt;&lt;div class="popup-content"&gt;&lt;/div&gt;&lt;/div&gt;'); var popupContent = popup.children('div'); var overlay = $('&lt;div id="overlay"&gt;&lt;/div&gt;'); console.log(popup); console.log(popupContent); console.log(overlay); console.log(overlay.add(popup).appendTo('body')); }); </code></pre> <p>I've added some debugging in there in case you want to test it.</p> <p>I don't understand why only the overlay gets appended when appendTo() is being called on a jQuery object containing two elements?</p> <p>Any help would be much appreciated. </p>
javascript jquery
[3, 5]
2,997,161
2,997,162
Is it easier to learn PHP if you know Java?
<p>I'm taking classes this spring semester, and what I want to know is whether it will be easier to learn PHP if you already know Java.</p>
java php
[1, 2]
2,388,546
2,388,547
Create voice recognition app
<p>I need to develop an App witch detects voice when it´s running (not what are they saying, just if someone speaks) and if so, I need to launch an especific mp3 from my sd.</p> <p>I never developed for android/iphone but I need to especify my boss in how many hours it could be done.</p> <p>Is there any easy way for voice recognition? and... I think that the answear could be yes but, is ther a way to listen a specified mp3 from my code?</p> <p>(no plataform specified yet, it could be android or iphone)</p> <p>Thanks very much in advance</p>
iphone android
[8, 4]
1,127,987
1,127,988
javascript length duration
<p>i have following function in php, how can i convert this in javascript?</p> <pre><code> function length_duration ($seconds) { $hours = $mins = $sec = NULL; //for seconds if($seconds &gt; 0) $sec = ($seconds % 60 &lt; 10) ? "0".($seconds%60) : ($seconds%60); //for mins if($seconds &gt; 60) $mins = (($seconds/60%60)&lt;10) ? "0".($seconds/60%60).":" : "".($seconds/60%60).":"; //for hours if($seconds/60 &gt; 60) $hours = (($seconds/60/60) &lt; 10) ? "0".($seconds/60/60).":" : "".($seconds/60/60).":"; return $hours.$mins.$sec; } </code></pre>
php javascript jquery
[2, 3, 5]
1,161,021
1,161,022
Simple Javascript Funtion - 2 Choices, each going to a different URL
<p>I'm trying to figure out how to have a Confirm/Decline box pop up when someone clicks a link. When they click "Ok" it takes them to one place, when they click "Cancel" it takes them to another place. Most of my experience is with php but usually I can take other javascript functions and make them work.. can't seem to figure this one out though.</p> <p>Here's my script:</p> <pre><code>function confirmChoice(name, newid){ answer = confirm("Transfer Ownership of this task to " + name + "? Press Cancel to decline.") if (answer == 1) { location = "transfer.php?task=&lt;? echo $taskid; ?&gt;&amp;from=&lt;? echo ownerid; ?&gt;&amp;to=" + newid; } elseif (answer==0) { location = "decline.php?task=&lt;? echo $taskid; ?&gt;"; } } </code></pre> <p>Any help would be greatly appreciated!</p> <p>EDIT: Okay, changed the code as suggested. Now it is:</p> <pre><code>function confirmChoice(name, newid){ var answer = confirm("Transfer Ownership of this task to " + name + "? Press Cancel to decline.") if (answer){ location = "transfer.php?task=&lt;? echo $thistaskid; ?&gt;&amp;from=&lt;? echo $ownerid; ?&gt;&amp;to=" + newid; }else{ location="decline.php?task=&lt;? echo $thistaskid; ?&gt;"; } } </code></pre> <p>And the link used is: </p> <pre><code>&lt;a href="#" onclick="confirmChoice(&lt;? echo $requestorname; ?&gt;, &lt;? echo $newid; ?&gt;); return false;"&gt;&lt;? echo $requestorname; ?&gt; Requested Ownership&lt;/a&gt; </code></pre> <p>I still don't get a confirm box.. thanks so much for the help!</p>
php javascript
[2, 3]
3,068,444
3,068,445
Accessing datatable from different methods
<p>I am creating a web application with back-end on ISeries. In the page load I am populating a datatable and using it as a datasource for my gridview.</p> <p>What is the best possible way to access the data in the datatable from other methods, on the same page? And in other pages?</p> <p>The way I do currently is to get data from the gridview and populate in another datatable and then use it... Is there a better (elegant) way to do that? Is storing it in session a good idea??</p> <pre><code>public partial class Main : System.Web.UI.Page { public DataTable dt; protected void Page_Load(object sender, EventArgs e) { loadData ld = new loadData(); dt = ld.loadTable(); GridView1.DataSource = dt; GridView1.DataBind(); } protected void btn_Click(object sender, EventArgs e) { foreach (DataRow row in dt.Rows) { // do something } } } </code></pre>
c# asp.net
[0, 9]
880,080
880,081
Get HTTP for a site which also has Javascript on it in C#
<p>I need to get the HTML of a website which is heavy on Javascript. When I try to do I get a receive code, but it is filled with Javascript. </p> <p>Can I execute that JS after downloading and get the resulting HTML out of it?</p>
c# javascript asp.net
[0, 3, 9]
2,486,247
2,486,248
msrdpclient.connect failed to connect when accessign with IP on win7
<p>I am using msrdpClient ActiveX control in my web app to connect to other system on network remotly. My app simply get username, passwrod , domain and resolution and call connect function. But problem is when i use "http://localhost:8080/CMSServer/ie.html" to connect it works fine but if i use my system IP instead of localhost as "http://192.168.3.39:8080/CMSServer/ie.html", it got failed to connect throwing no exception just do nothing on connect button."http://localhost:8080/CMSServer/ie.html" is my web app address" is my web app address. Problem is only with windows 7.Its working fine on windowsXp. Can anybody tell me its solution. My connect code is</p> <pre><code> MsRdpClient.server = machineName; MsRdpClient.UserName = machineUsername; MsRdpClient.AdvancedSettings.ClearTextPassword = password; MsRdpClient.DesktopWidth = desktopWidth; MsRdpClient.DesktopHeight = desktopHeight; MsRdpClient.ColorDepth = colorquality; MsRdpClient.FullScreen = true; MsRdpClient.Advancedsettings3.ConnectionBarShowRestoreButton = false; MsRdpClient.Connect(); </code></pre> <p>Thanks in advance</p>
java javascript
[1, 3]
1,087,614
1,087,615
Set programmaticaly the Text property calling a function from code behind
<p>I'd like to initialise the label of the button from function from code behind:</p> <pre><code>&lt;asp:Button ID="BtnAjoutClient" runat="server" Text='&lt;%= GetText()%&gt;' /&gt; </code></pre> <p>and in the code behing a simple function like:</p> <pre><code>protected String GetText() { return "test"; } </code></pre> <p>But the caption of the button shows me the raw code (and the function is never called). I tryied also <code>&lt;%# GetText() %&gt;</code>. Do you know why ?</p> <p>Regards</p>
c# asp.net
[0, 9]
2,594,804
2,594,805
Getting name of object as a string in JavaScript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/85992/how-do-i-enumerate-the-properties-of-a-javascript-object">How do I enumerate the properties of a javascript object?</a><br> <a href="http://stackoverflow.com/questions/3982721/javascript-getting-a-single-property-name">Javascript: Getting a Single Property Name</a> </p> </blockquote> <p>Given a JavaScript object or JSON object such as:</p> <pre><code>{ property: "value" } </code></pre> <p>How can one get the word <code>property</code> as a string?</p>
javascript jquery
[3, 5]
1,923,672
1,923,673
Shuffling an array in c++
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3169015/how-exactly-should-i-implement-a-shuffle-or-random-number-algorithm-for-an-array">How exactly should I implement a shuffle or random-number algorithm for an array to display quotes in random order?</a> </p> </blockquote> <p>I have a small array that I need the values to be randomly shuffled around within the array. I can do this in python using random.shuffle(), but I can seem to figure out how to do it in C++.</p> <p>Here is an example in python of what I want to do in C++</p> <pre> <code> #!/usr/bin/python import random array = [1,2,3,4,5] random.shuffle(array) print array </code> </pre>
c++ python
[6, 7]
4,283,753
4,283,754
Unexpected JS/jQuery Loop Behavior
<p>I have the following loop. The goal is to automatically show text boxes when a user chooses certain options in a dropdown list.</p> <p>For some reason, in the following code, the loop assigns the "sponsor" field to the associated array for "blurb". I cannot figure out why. How can I make this work?</p> <p>Thanks so much.</p> <pre><code>function add_fields_on_change () { var map = { "sponsor" : Array("New Sponsor", "new_sponsor"), "blurb" : Array("New Blurb Suggestion", "new_blurb") }; for (field in map) { alert($('.bound[name='+field+']').val()); //alerts as expected $('.bound[name='+field+']').change(function() { alert(map[field][0]); //alerts "New Blurb Suggestion" for both "sponsor" and "blurb" fields if ($(this).val() == map[field][0]) { $('.hidden[name='+map[field][1]+']').show(); } }); } } </code></pre>
javascript jquery
[3, 5]
2,492,570
2,492,571
.net - based Help & Support / Knowledge base
<p>I am looking for a .net-based Help &amp; Support / Knowledge base to plug in to our website. It can be either open source or for purchase. Can anyone make a recommendation as to what are the best products?</p>
c# asp.net
[0, 9]
1,278,779
1,278,780
Need help understanding why javascript object property is undefined
<p>I need help understanding why the following piece of code returns an undefined object property: </p> <pre><code>var count = 0; var intervals = { collection : [] } intervals.collection[0] = function () { this.timer = setInterval(function(){ count++; $("p").html(count); }, 1000); }(); if(typeof intervals.collection[0] === "undefined") { $("span").html("undefined"); }​ </code></pre> <p>Working Example: <a href="http://jsfiddle.net/tvaQk/8/" rel="nofollow">http://jsfiddle.net/tvaQk/8/</a></p> <p>Basically, I'd like to be able to keep a collection of setIntervals that I can reference later so I can loop through and clear. I was thinking I'd be able to loop through the intervals.collection array and do something like:</p> <p><code>clearInterval(intervals.collection[0].timer)</code></p> <p>but cannot since <code>intervals.collection[0]</code> is undefined</p>
javascript jquery
[3, 5]
5,884,049
5,884,050
default resolution is lower than actual resolution of my device
<p>i have used</p> <pre><code>DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); cube.height=metrics.heightPixels; cube.width=metrics.widthPixels; </code></pre> <p>to get height and width of my display but the resolution is low for my sony xperia p device which is qhd display. from this function i can only get height=569 px and width=320 px i don't understand why this is showing lower. i think this is giving me virtual resolution than real one. i used simple view and ondraw method to draw the canvas.</p> <p>please help.</p>
java android
[1, 4]
5,220,858
5,220,859
always keep the window in the center when move the scroll bar
<p>I am trying to built a window located in the center of the screen and when I scroll down it will always be in the center, I have tried the follwing code:</p> <pre><code> &lt;style&gt; #Window { display: none; text-align: center; border: 1px solid #333; position:absolute; width: 200px; height: 80px; z-index:9999; background:#fff; border-radius: 5px; padding: 10px; } &lt;/style&gt; &lt;script&gt; $("#window").css('top', 200); $("#window").css('left', winW/2- $("#window").width()); $(window).scroll(function () { var winH = $(window).height(); setTimeout( function(){ $('#alertWindow').animate({'top':winH/2-$("#window").height()/2},200); }, 1000); }); &lt;/script&gt; &lt;div id="window"&gt;this is scroll window&lt;/div&gt; </code></pre> <p>The problem is that when I scroll down, the window moves to the center at the first time which works, but when I scroll again, it won't keep moving to the center, I think the scroll function is only called once, how can I keep the window move constantly to the center of the creen when I scroll down or up, any one could help me with that, sorry if I did present the whole code.</p>
javascript jquery
[3, 5]
3,875,573
3,875,574
Pulling data-caption from image with Elastic Image Slideshow, and display it on the page
<p>I am using the <a href="http://tympanus.net/codrops/2011/11/21/elastic-image-slideshow-with-thumbnail-preview/" rel="nofollow">Elastic Image Slideshow</a> script, and would like to add data-caption text for each image, then display the text of the currently shown image into a div, outside of the slideshow (basically in a different section of the page.)</p> <p>I found <a href="http://blog.fraser-hart.co.uk/add-captions-to-jquery-cycle/" rel="nofollow">this script</a>, to work with jQuery cycle, and tried to modify it to work but I am not having much luck.</p> <p>Ok, I found this fiddle: <a href="http://jsfiddle.net/Snfst/6/" rel="nofollow">http://jsfiddle.net/Snfst/6/</a> and modified it down to this:</p> <pre><code> $('img').hover(function(){ $('#caption').html($(this).data('caption')) }); </code></pre> <p>Question now is how do I get it to load without having to hover over the image, and only show the data for the currently shown image?</p> <p>The page that I'm trying to make this work on might better show what I'm trying to do: <a href="http://diguiseppi.com/Brad/Andy/portfolio-web-design.html" rel="nofollow">http://diguiseppi.com/Brad/Andy/portfolio-web-design.html</a></p>
javascript jquery
[3, 5]
5,898,679
5,898,680
could jquery live solve this problem? table links are bound to click, ajax refresh of rows ruins things
<p>I have a table, that I loop through using jquery and modify the href of each link.</p> <p>IF someone pages through the table, the links are refreshed using ajax (page doesn't reload).</p> <p>Now all my links are not modified since the table has refreshed.</p> <p>Paging is done via a drop down list.</p> <p>Can jquery live help in some way to re-apply the modifications to the urls that I do when the page initially loads up?</p> <pre><code> $("#someTableID").each(function () { // modify href of links in each row, append ?user=342 to it. } </code></pre>
javascript jquery
[3, 5]
2,090,773
2,090,774
Java concurrent modification exception when removing items from list
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5145135/java-util-concurrentmodificationexception-on-arraylist">java.util.ConcurrentModificationException on ArrayList</a> </p> </blockquote> <p>I am trying to remove items from a list inside a thread. I am getting the <code>ConcurrentModificationException</code>. I read from this <a href="http://stackoverflow.com/questions/8090398/java-concurrent-modification-exception">link</a> that it's related to removing items from list. I am putting the sample code below. How can I do this properly without this exception in my case.</p> <pre><code>try { for(Game game:appDeleg.getGlobalGames().getGames()) { if(game.getOwner().getId().equals(params[0])) { synchronized (appDeleg.getGlobalGames().getGames()) { appDeleg.getGlobalGames().getGames().remove(game); } } } } catch (Exception e) { e.printStackTrace(); return "noconnection"; } </code></pre>
java android
[1, 4]
5,202,647
5,202,648
Arrays in php & javascript syntax issues
<p>I have got my self confused on how to construct arrays correctly in PHP prior to my json encode to check them in javascript.</p> <p>I'm trying to store an array of objects with their grid reference (x,y)</p> <p>So i do this in php:</p> <pre><code> $get = mysql_query("SELECT x,y,sid FROM $table WHERE uid='1'") or die(mysql_error()); while($row = mysql_fetch_assoc($get)) { $data[$row['x'].$row['y']] = $row['sid']; } //print_r($data); $data = json_encode($data); </code></pre> <p>In javascript i then try to check if a object exists on a given co-ordinate so i try this:</p> <pre><code> for (i=0;i&lt;tilesw;i++){ //horizontal for (j=0;j&lt;tilesh;j++){ // vertical if(sdata[i.j]){ alert(sdata[i.j][sid]); } } } </code></pre> <p>sdata is my array after json encode.</p> <p>My json encode looks like this:</p> <pre><code> {"44":"0","21":"0"} </code></pre> <p>Problem is i get : Uncaught SyntaxError: Unexpected token ] on the alert line.</p> <p>Also is my approach correct or is there a better way to construct my array?</p>
php javascript
[2, 3]
1,249,253
1,249,254
Get the title of a page/url
<p>Using php or javascript I want to get the title of the page Any help encouraged</p>
php javascript
[2, 3]
5,197,069
5,197,070
I need to make Dynamic Collapsible Panel in ASP.NET using c#
<p>I need To make Dynamic Collapsible Panel in ASP.NET using C#. </p> <p>What is the best way to do this?</p>
c# asp.net
[0, 9]
1,395,691
1,395,692
</script> in string ends script section
<p>I'm having an issue where I'm trying to use JQuery to append a string to a div.</p> <p>This string will be HTML, and occassionally users will be using the script tags inside the string.</p> <p>Unfortunately, when the browser reads <code>&lt;/script&gt;</code> inside the string, it ends the section and prints out all the following javascript into the browser. Obviously, we don't want that.</p> <p>Is there a way to get the browser to not parse anything inside the string?</p> <p>An example of this might be an Adsense ad being appended to the div.</p>
javascript jquery
[3, 5]