Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
4,699,647
4,699,648
After adding a row in to the repeater , when i refersh page , again that row is being repaeted in datable .. how to solve this?
<p>when i refersh page , again that row is being repaeted in datable .. how to solve this?</p> <pre><code>DataTable dt1 = new DataTable(); da1.Fill(dt1); DataView dv = new DataView(dt1); rptMatrixs.DataSource = dv; rptMatrixs.DataBind(); </code></pre>
c# asp.net
[0, 9]
2,984,293
2,984,294
jquery check if asp checkbox is checked
<p>Hello everyone I have a checkbox I want to check if its checked or no on client side, before postback happens. Here is the checkbox:</p> <pre><code> &lt;asp:CheckBox runat="server" CssClass="checkbox" Checked="true" ID="checkboxRules" /&gt; </code></pre> <p>Thanks in advance, Laziale</p> <p>UPDATE: The problem is that there is a button on the page too which is triggered by js code, and maybe I can add a line there to check if the checkbox is checked once the button is clicked, otherwise display message for unchecked checkbox:</p> <p>function enterClick() { $('#SUBMIT').click(); }</p> <pre><code>var ishown = false; $(document).ready(function () { $('#BUTTON').click(function (e) { </code></pre> <p>//I want to put the checkbox logic here</p> <p>Thanks again</p>
javascript jquery asp.net
[3, 5, 9]
4,465,217
4,465,218
javascript stack data structure library to implement undo/redo functionality
<p>I need to implement an Undo/Redo system on a rather complex web application (which is using jQuery). Whilst I can quite happily implement a custom solution myself using an array of objects holding state and push/pop calls etc., is there any particularly good library of a data structures available for javascript which would benefit me? </p> <p>Please do not reply with examples of how to implement a stack in javascript, this question arises more because the development of javascript libraries continues at a pace that makes it easy to miss 'must use' libraries.</p>
javascript jquery
[3, 5]
1,215,675
1,215,676
Is it bad practice to assign a css class for the sole purpose of finding it with jQuery?
<p>I'm using ASP.NET, not the newest one with that clientIdMode stuff. So, the control ids are generated and funky.</p> <p>There are lots of ways of passing ids around, but lately I've been assigning a 'fake' css class to the control I'm interested in. Then in a js file I use jQuery to find the control.</p> <p>Is this bad practice? It seems a lot like the ajaxControlToolkit's behaviorId to me... Is the behaviorId bad practice as well?</p>
asp.net jquery
[9, 5]
3,444,185
3,444,186
Select elements from jQuery selection
<pre><code>&lt;div class="a b"&gt;&lt;/div&gt; &lt;div class="a c"&gt;&lt;/div&gt; &lt;div class="a b"&gt;&lt;/div&gt; &lt;div class="a c"&gt;&lt;/div&gt; &lt;div class="a b"&gt;&lt;/div&gt; &lt;div class="a f"&gt;&lt;/div&gt; var selection = jQuery('div.a'); </code></pre> <p>Does anybody know a way to select divs with class="b" from <code>var selection</code> without iterating through array's elements and checking their class one by one?</p>
javascript jquery
[3, 5]
1,273,462
1,273,463
How do you Response.Redirect to another website with the same name, but with different port?
<p>I have two separate websites running locally on my IIS server at work. One is on normal port 80 and the other 90. Now, I have a Default page which makes the users select one of the pictures that will redirect them to the correct website. </p> <p>It works fine with the port 80, since you don't have to specify which port you are running a normal website, but how can I redirect the second picture to redirect to port 90.</p> <p>This is the code I have, but it keeps adding a stupid forward slash... </p> <pre><code>Response.Redirect(Request.ApplicationPath + ":90/login.aspx"); </code></pre> <p>It ends up showing <a href="http://192.168.2.122/:90/login.aspx" rel="nofollow">http://192.168.2.122/:90/login.aspx</a>.</p> <p>Any help will be gladly appreciated. Thanks!</p>
c# asp.net
[0, 9]
4,746,465
4,746,466
using for loop in jquery
<pre><code>$(document).ready(function() { $for(i=1;i&lt;8;i++) { $("#"+i).hover(function() { $("#"+i).stop().animate({left:"50px"}); }, function() { $("#"+i).stop().animate({left:"30px"}); }); } }); </code></pre> <p>I used for loop here to avoid multiple declaration of hover function it doesnt work how can i declare my div id my div id was 1-7.plz tell me how i should use the div ids inside the loop.</p>
javascript jquery
[3, 5]
4,861,872
4,861,873
Adding feedback buttons
<p>I've a static html file that is generated from docbook5 sources. Now I need to add feedback buttons, at the end of each section, so I'm appending (using jQuery) a link after each title:</p> <pre><code>$(document).ready(function() { $("div[title]").append('&lt;a href="mailto:me@host?subject=XXX"&gt;feedback&lt;/a&gt;'); }) </code></pre> <p>how to insert the div[title] into subject? </p> <p><strong>EXAMPLE</strong></p> <pre><code>&lt;div title="Foo"&gt; ... &lt;/div&gt; &lt;div title="Bar"&gt; ... &lt;/div&gt; </code></pre> <p>I want two buttons placed right after the closing div:</p> <pre><code>&lt;div title="Foo"&gt; ... &lt;/div&gt;&lt;a href="me@host?subject=Foo"&gt;feedback&lt;/a&gt; &lt;div title="Bar"&gt; ... &lt;/div&gt;&lt;a href="me@host?subject=Bar"&gt;feedback&lt;/a&gt; </code></pre>
javascript jquery
[3, 5]
709,331
709,332
How do I run different versions of jQuery on the same page?
<p>My company has purchased a product that renders an ASP.NET control on the page. This control uses jQuery 1.2.3 and adds a script tag to the page to reference it. The developers of the control will not support use of the control if it modified in any way (including modification to reference a different version of jQuery).</p> <p>I'm about to start development of my own control and would like to use the features and speed improvements of jQuery 1.3. Both of these controls will need to exist on the same page.</p> <p>How can I allow the purchased control to use jQuery 1.2.3 and new custom development to use jQuery 1.3? Also out of curiosity, what if we were to use an additional control that needed to reference yet another version of jQuery?</p>
asp.net javascript jquery
[9, 3, 5]
5,459,775
5,459,776
Will jquery live work for $('#somebutton').data('events').click?
<p>The events for a button get wired up after the page loads, so I need to use live for this.</p> <p>Will live work for this:</p> <pre><code>$('#somebutton').data('events').click; </code></pre>
javascript jquery
[3, 5]
854,106
854,107
jquery looping through input fields and going into parent and siblings
<p>Hello all Im stuck with some code hoping to get help. I have my html set up like so: <br> <br> <br> </p> <pre><code> &lt;div class="menu_options"&gt; &lt;div class="parent_options"&gt; &lt;input type="checkbox" class="parent_required" /&gt; &lt;/div&gt; &lt;div class="children"&gt; &lt;div class="child_options"&gt; &lt;input type="checkbox" class="child_required" /&gt; &lt;/div&gt; &lt;div class="child_options"&gt; &lt;input type="checkbox" class="child_required" /&gt; &lt;/div&gt; &lt;div class="child_options"&gt; &lt;input type="checkbox" class="child_required" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Basically what im trying to do is in jquery if the parent_required class checkbox is checked get all the input fields under the children class and all input fields class by child_required uncheck them.</p> <p>I cannot use id' on the input fields because i just dont know all the id's for the fields to use.</p> <p>so far in jquery i have this code</p> <pre><code> $('.parent_required').click(function() { if(!$(this).is(":checked")) { var child = $(this).parent('.parent_options').siblings('.children'); } }); </code></pre> <p>and im suck here at the div class='children part dont know how to get deeper in. </p>
javascript jquery
[3, 5]
2,556,796
2,556,797
Jquery remove text from span
<p>I'm new to JQuery and really struggling how to perform the query I want.</p> <p>I'm using SharePoint, and the when using the External Data Column and set it to required field, the error message always appears until you fill in the data. Unlike other type columns where they only appear after you click OK/Save and not filled in the data. Therefore I need to remove the error message text just from these type of columns.</p> <p>I assume I need to search for span within the .ms-error class that contains the words 'External Data' and hide it.</p> <p>From using IE developer toolbar, I've identified the area.</p> <pre><code> &lt;table class="ms-usereditor" id="ctl00_m_g_05df537a_596b_443a_a11e_764069facec8_ctl00_Field_External_539c53fe_8334_43c8_b089_cc28d7895e68_Picker_OuterTable" style="border-collapse: collapse;" border="0" cellSpacing="0" cellPadding="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td colSpan="3"&gt; &lt;span class="ms-error" id="ctl00_m_g_05df537a_596b_443a_a11e_764069facec8_ctl00_Field_External_539c53fe_8334_43c8_b089_cc28d7895e68_Picker_errorLabel"&gt; Text - You must specify a value before using the Check button. You can also use Select button to choose External Data. </code></pre> <p>Please can someone help me with the JQuery. </p>
javascript jquery
[3, 5]
2,165,294
2,165,295
VS2008 Illegal Reading Of String Text
<p>I declaring a string of Special Characters.</p> <pre><code>var SpecialCharSequence = "',!,#,$,%,&amp;,',(,),*,+,-,.,\,/,:,;,&lt;,=,&gt;,?,@,[,],^,_,{,|,},~,"; </code></pre> <p>Why its giving a error for backward Slash </p> <pre><code>Unrecognized escape sequence </code></pre> <p>When already its in Quotation marks. </p>
c# asp.net
[0, 9]
3,454,637
3,454,638
JQuery | change the innert html content of ul->li->a
<p>I have the following html</p> <pre><code> &lt;ul class="links main-menu"&gt; &lt;li class="menu-385 active-trail first active"&gt;&lt;a class="active" title="" href="/caribootrunk/"&gt;HOME&lt;/a&gt;&lt;/li&gt; &lt;li class="menu-386 active"&gt;&lt;a class="active" title="" href="/caribootrunk/"&gt;FIND LOCAL PRODUCTS&lt;/a&gt;&lt;/li&gt; &lt;li class="menu-387 active"&gt;&lt;a class="active" title="" href="/caribootrunk/"&gt;DO BUSINESS LOCALLY&lt;/a&gt;&lt;/li&gt; &lt;li class="menu-388 active"&gt;&lt;a class="active" title="" href="/caribootrunk/"&gt;LOCAL NEWS &amp;amp; EVENTS&lt;/a&gt;&lt;/li&gt; &lt;li class="menu-389 active"&gt;&lt;a class="active" title="" href="/caribootrunk/"&gt;BLOG&lt;/a&gt;&lt;/li&gt; &lt;li class="menu-390 last active"&gt;&lt;a class="active" title="" href="/caribootrunk/"&gt;ABOUT US&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I am new to jquery. What I want is i want to wrap inner html of anchor tag(e.g. Home etc) in in a span. I want this functionality through jquery on document ready.</p>
javascript jquery
[3, 5]
5,111,659
5,111,660
Finding phrases in string. Is there a more elegant way of doing this?
<p>I'm looking to search for 2 or 3 key phrases in a string called <code>lastTestText</code> and I want to return a <code>Boolean</code>. It works nicely with:</p> <pre><code>Boolean tooLong = lastTestText.contains("hour") | lastTestText.contains("min"); </code></pre> <p>But this is going to get a bit long-winded if I have 4 or 5 phrases so I wondered if there's a more elegant way of doing this?</p>
java android
[1, 4]
5,926,289
5,926,290
why hidden field value won't be updated
<p>Look at this code :</p> <pre><code> function ToggleMenu() { var v = $("#MenuVisibility").val() ; if (v == "1") { $('#MenuVisibility').val("0"); } else { $('#MenuVisibility').val("1"); } v = $("#MenuVisibility").val(); alert(v); } &lt;/script&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="hidden" value="1" id="MenuVisibility" /&gt; &lt;form id="form1" runat="server"&gt; &lt;div id="Menu"&gt; &lt;a class="MainMenu" href="#" onclick="OpenCloseMenu()"&gt;Fun&lt;/a&gt; &lt;div id="ExtendedMenu"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Item 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Item 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Item 3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Item 4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Item 5&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;asp:Button ID="Button1" runat='server' Text="Toggle Menu" OnClientClick="ToggleMenu()" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>When i click for first time , hidden field value sets to 0 , but when I click for second time, it value won't changed to 1 . why ? </p>
javascript asp.net
[3, 9]
98,842
98,843
jQuery to hide all classes that start with 'row' except ‘row2’ only when the parent class is viewContainerTop
<p>A variation of <a href="http://stackoverflow.com/questions/1719047/jquery-to-hide-all-row-classes-except-row2-only-when-the-parent-class-is-viewc">this question...</a></p> <pre><code>&lt;div id="viewContainerTop"&gt; &lt;div class="row1"&gt;&lt;/div&gt; &lt;div class="NotRow1"&gt;&lt;/div&gt; &lt;div class="row2"&gt;&lt;/div&gt; &lt;div class="row2"&gt;&lt;/div&gt; &lt;div class="row2"&gt;&lt;/div&gt; &lt;div class="row3 first"&gt;&lt;/div&gt; &lt;div class="donthideme"&gt;&lt;/div&gt; &lt;div class="row4"&gt;&lt;/div&gt; &lt;div class="row5"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
4,007,590
4,007,591
How do I share a variable among multiple methods?
<p>after saved instance I need share "int audio" to check() method to do several operations. I've an "info" option: when I click I see info dialog and I'd like listen audio (stop it when I click on "cancel"). But when I rotate emulator, I've another audio stars.</p> <pre><code>int audio; static int Info; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); if (savedInstanceState != null) { int Info = savedInstanceState.getInt("dialoginfo"); int audio = savedInstanceState.getInt("audio"); } if(Info != 0) { Info(); } private void Info(){ Info = 1; sobCheck(); LayoutInflater li = LayoutInflater.from(this); View view = li.inflate(R.layout.info, null); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setView(view).create(); TextView text=(TextView) findViewById(R.id.infoView1); builder.setCancelable(false); builder.setPositiveButton("Chiudi", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Info = 0; mp.stop(); mp.reset(); mp.release(); mp = null; audio = 0; dialog.cancel(); } }); builder.show(); } private void sobCheck(){ if (audio == 0){ mp = MediaPlayer.create(this, R.raw.sob); mp.start(); audio = 1; } protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt("audio", a); </code></pre> <p>after rotate screen, "audio" is always "0"</p>
java android
[1, 4]
5,986,515
5,986,516
Converting ArrayList<Double> to Double Array and visa-versa for JAVA/Android
<p>I've been trying to convert a Double ArrayList to a Double Array and visa-versa.</p> <p>This is the code I have for converting Double ArrayList to Double Array, but the program keeps on crashing. Am I missing something? or is the logic wrong all together?</p> <pre><code>ArrayList&lt;Double&gt; numsy = new ArrayList&lt;Double&gt;(); ArrayList&lt;Double&gt; numsx = new ArrayList&lt;Double&gt;(); for (int j = 0; j &lt; 100; j++) { numsy.add((double)generator.nextFloat()); numsx.add((double)j); } double[] arrayX = new double[numsx.size()]; double[] arrayY = new double[numsy.size()]; //assigns array x and y the values in the list. for (int k1 = 0; k1 &lt; numsy.size(); i++) { double f = numsy.get(k1); arrayY[k1] = f; f = numsx.get(k1); arrayX[k1] = f; } FFT doFFT = new FFT(4); doFFT.fft(arrayX, arrayY); //adding the FFT numbers back to the Lists for (int j = 0; j &lt; 100; j++) { numsy.add(arrayY[j]); numsx.add(arrayX[j]); } </code></pre>
java android
[1, 4]
2,694,795
2,694,796
How to sort a table consisting of multiple TBODY tags?
<p>Say there are 3 TBODY tags inside one single table containing 3,4 and 5 number of columns. Is it possible for all the TBODIES to get sorted if any column header on say TBODY1 is clicked. I want the whole table to get sorted , not just the columns in one particuular TBODY. I had some reason for which I had to use multiple TBODY's inside one single table. Can anyone guide me on this ?</p> <p>Thanks</p>
javascript jquery asp.net
[3, 5, 9]
1,092,539
1,092,540
Unique Event names
<p>I'm just tried to <code>bind</code> and <code>trigger</code> <code>isDisabled</code> event on input element.</p> <p>But got an error in IE8. Because specific <code>isDisabled</code> event already exists <a href="http://msdn.microsoft.com/en-us/library/ie/ms533902(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ie/ms533902(v=vs.85).aspx</a></p> <p>How do I make unique event names and keep them readable?</p> <p>Is there a better way then using something like <code>thisNodeWasDisabled</code> ?</p>
javascript jquery
[3, 5]
3,999,423
3,999,424
Setting a relative file reference for XmlReader
<p>Today for testing I'm using:</p> <pre><code>XmlReader ProductDoc = XmlReader.Create(@"c:\inetpub\wwwroot\data\xml\foo\bar.xml", settings); </code></pre> <p>I need to make this more relative instead of a fully qualified name but can't seem to find a way to make it work.</p> <p>I really don't have a lot of access to the web.config file and so don't want to go there.</p> <p>Ideas?</p>
c# asp.net
[0, 9]
2,951,246
2,951,247
Which iPhone first supported JavaScript?
<p>What version of the iPhone first supported JavaScript?</p>
javascript iphone
[3, 8]
2,673,594
2,673,595
jQuery won't let me do if blocks?
<p>I am trying to do a fade effect, that fades out a div and substitutes it for another. For that I have created a lastDiv var which sets the number of the last div clicked. </p> <p>But when I try to set an if js says there is an error. I am pretty sure that I am using the correct syntax. (I am a beginner) </p> <p>Thanks </p> <p></p> <pre><code>var lastDiv = 1; $("#item1").click(function () { if(lastDiv == 2) { $("#div2").fadeOut(0500, function() { $("#div1").fadeIn(500, function () {lastDiv = 1;}); }); }); } else if (lastDiv == 3) { $("#div3").fadeOut(0500, function() { $("#div1").fadeIn(500, function () {lastDiv = 1;}); }); }); } $("#item2").click(function () { if(lastDiv == 1){ $("#div1").fadeOut(0500, function() { $("#div2").fadeIn(0500, function () {lastDiv = 2;}) }); }); } else if(lastDiv == 3){ $("#div3").fadeOut(0500, function() { $("#div2").fadeIn(0500, function () {lastDiv = 2;}) }); }); } $("#item3").click(function () { if(lastDiv == 1) { $("#div1").fadeOut(0500, function() { $("#div3").fadeIn(0500, function () { lastDiv = 3 }) }); } else if(lastDiv == 2) { $("#div2").fadeOut(0500, function() { $("#div3").fadeIn(0500, function () { lastDiv = 3 }) }); } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,680,271
3,680,272
Set current url with jQuery?
<p>How do change the url shown with the jQuery? With pagination, I do an ajax call to get the next page, but I want to update the url for bookmarking purposes. How do I do that?</p>
javascript jquery
[3, 5]
5,591,649
5,591,650
progress bar in asp.net
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/9080470/progress-bar-on-a-survey-using-c-sharp">progress bar on a survey using c#</a> </p> </blockquote> <p>I made an on-line survey in ASP .NET using C#. My survey contains 30 questions with each question on a different page. I want to display a progress bar that will show the user how much he completed. How can I do that?</p> <p>I think that if I know the total number of pages, on each page when I hit the submit button the progress bar will fill according to the page the user is on. For example, if i am on the 5th page out of 30 then the progress bar should fill with 5 / 30 or something like this.</p>
c# asp.net
[0, 9]
4,163,085
4,163,086
How to add a specific class to appended LI which is loaded via ajax?
<p>This is my code. What I am trying to do is add a class "featured" to the first li item which gets added to this UL however, when I try this code, it does not work, it always add the class to every li inserted, while I want the class to be added only if there are no li in the ul and to the first li element added to this UL.</p> <p>My code:</p> <pre><code>$(".img_add").click(function(event){ event.preventDefault(); $('input:submit, p.upload-result').hide(); // hide submit button + results while working $(this).parent().after('&lt;p class="loading"&gt;&lt;img src="&lt;?php bloginfo('template_directory'); ?&gt;/img/loading_2.gif" alt="" /&gt;&lt;/p&gt;'); var path_img = $("#img_url").val(); var count_images_lib = $(".upload-images-lib").length; $.ajax({ url: '&lt;?php bloginfo('template_directory'); ?&gt;/ajax/add_image_url.php', type: 'POST', data: { path : path_img }, dataType: 'json', success: function(data){ $('.loading').remove(); $('input:submit').show(); if (data.status) { $('.upload-images-lib').prepend(data.message); if (count_images_lib == 1) { $('.upload-images-lib li:first-child').addClass('featured'); } alert(count_images_lib); $('p.upload-result').fadeIn(500).html('&lt;span class="success"&gt;&lt;?php _e('Your image has been added successfully.','sofa'); ?&gt;&lt;/span&gt;'); } else { $('p.upload-result').fadeIn(500).html('&lt;span class="error"&gt;' + data.message + '&lt;/span&gt;'); } } }); }); </code></pre> <p>What I want is to add the class to the first loaded li only. <strong>Please note: data.message is actually a list item in html format.</strong></p> <p>The problem is with count_images_lib always returning 1 and thus my class is added everytime. It is not with first/last selector.</p>
javascript jquery
[3, 5]
4,491,978
4,491,979
Using jQuery to add tick box values to a hidden field
<p>I am trying to collect tick box values and assign the ticked boxes values to a hidden field so that I can save all of the ticked boxes values into one column in a comma delimited format, instead of many.</p> <p>How could I go about doing that?</p> <p>Thanx in advance!</p>
javascript jquery
[3, 5]
4,456,912
4,456,913
How to get full ClientID for a control from server side code
<p>I have a <code>TextBox</code> inside <code>ItemTemplate</code> of a <code>Repeater</code> that is also inside a <code>ItemTemplate</code>. </p> <p>Server side I have:</p> <pre><code>protected void txtValorMaterialAsign_TextChanged(object sender, EventArgs e) { string controlId = ((TextBox)sender).ClientID; } </code></pre> <p>wich result in: </p> <p><code>rptFilasDeUnMaterial_ctl04_txtValorMaterialAsign</code></p> <p>But client side the Id for that control is (according to Chrome's F12):</p> <pre><code>ctl00_contenido_wucMateriales_rptMateriales_ctl00_rptFilasDeUnMaterial_ctl01_txtValorMaterialAsign </code></pre> <p>How can I get the full Id from server side code?</p>
c# asp.net
[0, 9]
5,245,602
5,245,603
one web application multiple database for each client difficulties with recognizing clients Request.Url.Host
<p>I have one <code>asp.net(iis7)</code> web app and multiple database in back-end.</p> <p>Every client has different url for example:</p> <p><strong>client1.test.com<br> client2.test.com</strong> </p> <p>Application should read url <code>(HttpContext.Current.Request.Url.Host)</code> and determine which database use.</p> <p>The problem is that from <code>iis7 HttpContext.Current.Request.Url.Host</code> in class not working(Request is not available in this context ).</p> <p>I don't have idea how to replace this mechanism. One web app for every client is not a solution.</p>
c# asp.net
[0, 9]
2,626,310
2,626,311
Cannot make a static reference to the non-static method
<p>I'm trying to insert string value from R.string resource xml file and i'm getting error message.</p> <p>here is the Java code:</p> <pre><code> public static final String TTT = (String) getText(R.string.TTT); </code></pre> <p>This is the error message:</p> <pre><code>Cannot make a static reference to the non-static method getText(int) from the type Context </code></pre> <p>How can i fix it ? i need it in order to make multi language application.</p> <p>Thanks in advanced</p>
java android
[1, 4]
2,464,255
2,464,256
Selecting JSON array with conditions in PHP
<p>I have a text file which displays all the records in datatables correctly but I want to display only the records with "ram". For example:</p> <pre><code>{ "aaData": [ ["ram","india"], ["siva","india"], ["mani","india"], ["ram","india"], ["ram","india"] ] } </code></pre> <p>I am using PHP and Symfony1.3. Please help me.</p>
php jquery
[2, 5]
2,692,442
2,692,443
Runtime error appeared after I moved some code to new class
<p>I had the code:</p> <pre><code>namespace ShowDiagram1 { public partial class WebForm1 : System.Web.UI.Page { bitmap.Save(Server.MapPath("pic1.jpg"), ImageFormat.Jpeg); Image1.ImageUrl = this.ResolveUrl("pic1.jpg"); } } </code></pre> <p>It worked okay. I moved this code to new class</p> <pre><code> namespace ShowDiagram1 { public class MyDraw : WebForm1 { ... bitmap.Save(Server.MapPath("pic1.jpg"), ImageFormat.Jpeg); Image1.ImageUrl = this.ResolveUrl("pic1.jpg"); } } </code></pre> <p>Now I have runtime error</p> <blockquote> <p>Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p> <p>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.</p> <p>Source Error:</p> <p>Line 85: Image1.ImageUrl = ResolveUrl("pic1.jpg");</p> </blockquote> <p>pic1.jpg was created okay.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
442,237
442,238
jquery fading through different css backgrounds
<p>I have a website and I want an image to change every 5 seconds, it's a css background on a DV. How can I achieve this with JQUERY? I have 3 different images that I want it to fade through and loop</p>
javascript jquery
[3, 5]
3,907,454
3,907,455
Javascript how to store predefined function (with arguments)
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1451009/javascript-infamous-loop-problem">Javascript infamous Loop problem?</a> </p> </blockquote> <p>I have the following:</p> <pre><code>function test(a,b,c){ console.log(a+b+c); } for (var i=0; i &lt; array.length; i++){ steps.push( funtion(){ test(array[i].something, array[i].wow, i);} ); </code></pre> <p>I want to store functions with several parameters, and bind them to buttons later when the DOM is loaded</p> <pre><code>for (var i=0; i&lt;steps.length; i++){ $('#mydiv li a').eq(i).click(steps[i]); } </code></pre> <p>It's not really working since steps[i] contains do(array[i].something, array[i].wow, i); instead of do('bob', 'john', 1) for example</p> <p>I have tried using the .apply javascript function but it will execute in the loop, instead of storing them</p>
javascript jquery
[3, 5]
338,932
338,933
how to use jquery's $.ajax error parameter
<p>how to use the error parameter of the jquery's $.ajax thing ? let's say i have a form, and then when I submit it, the data is being saved to the table using the PHP script used in the ,</p> <pre><code> $.ajax({ type: "POST", url: "classes/ajax.submitcv.php", data: "userid="+userid+"&amp;resumetitle="+resumetitle+"&amp;resumeintro="+resumeintro+ "&amp;name="+name+"&amp;dob="+dob+"&amp;contacttel1="+contacttel1+"&amp;contacttel1type="+contacttel1type+ "&amp;contacttel2="+contacttel2+"&amp;contacttel2type="+contacttel2type+"&amp;contacttel3="+contacttel3+ "&amp;contacttel3type="+contacttel3type+"&amp;primaryemail="+primaryemail+"&amp;secondaryemail="+secondaryemail+ "&amp;skype="+skype+"&amp;facebook="+facebook+"&amp;linkedin="+linkedin+"&amp;twitter="+twitter+ "&amp;messenger="+messenger+"&amp;yahoo="+yahoo+"&amp;aol="+aol+"&amp;summaryofpositionsought="+ summaryofpositionsought+"&amp;summaryofskills="+summaryofskills+"&amp;gender="+gender, success: function(){ $('form#wsrecruitcvhead').fadeOut("normal",function(){ $('div.success').fadeIn(1000); }); }, }); return false; }); }); </code></pre> <p>based from the code above, if the data went through the database table, the form disappears and the success message inside a tag shows, so how am I gonna output an error message instead, let's say I have a php function and the data to be inserted returns false, how to update the html file given the message and the form won't fadeOut ? in short..how to use the error param of $.ajax ?</p>
php javascript jquery
[2, 3, 5]
5,918,952
5,918,953
How to shield Android 4.0 HOME Key
<p>Does anybody know how to shield the HOME key in Android 4.0?</p> <p>The code below only works in 2.2 and 2.3, so how would I change this so it can work in 4.0?</p> <pre><code>/* FIXME: How does it works within Android 4.0? */ @Override public void onAttachedToWindow() { this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } </code></pre>
java android
[1, 4]
92,937
92,938
Need some ideas on creative DOM grabbing for a confirmation box
<p>What this little script does is it creates a context menu (right click) that has two options, delete and edit. Ideally it would just ask to confirm to delete, because it is not the end of the world if you accidentally get taken to the modify screen. But in either case, I would like to create some kind of unique message to each situation to display to the user.</p> <pre><code>$("#myDiv").contextMenu({ menu: 'myMenu' }, function(action, el, pos) { var yesno = confirm( 'Are you sure?' //you would like to delete? //you would like to edit ); if (yesno == true) { window.location(action); } }); </code></pre> <hr> <pre><code>&lt;div id="myDiv"&gt; Right click for options. &lt;/div&gt; &lt;ul id="myMenu" class="contextMenu"&gt; &lt;li class="edit"&gt; &lt;a href="some/edit/page"&gt; Edit &lt;/a&gt;&lt;/li&gt; &lt;li class="delete"&gt; &lt;a href="some/delete/page"&gt; Delete &lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <hr> <p>I am not sure of what the accepted methodology would be in this case to grab some information about the actions, because the last thing I want is to write some super convoluted code when there is an easier way to do it.</p> <p>This code seems moderately flexible, so I can add some more divs, or something like that. However, I would like to avoid a tag soup situation.</p>
javascript jquery
[3, 5]
1,292,346
1,292,347
Android - How to "invalidate" a Fragment in a FragmentPagerAdapter?
<p>I have an Android FragmentPagerAdapter that uses BitmapFragment (below), and it works great. Now I'm trying to switch out the Images on the fly. I've tried changing the ImageView but nothing changes. And I've tried using a FragmentTransaction.replace to swap it out, but I get an Invalid Argument exception. I know getImageViewAtPage() works and "bitmap" is a valid Bitmap.</p> <p>Thanks!</p> <pre><code>private class BitmapFragment extends Fragment { private int mPosition = 0; private ImageView mImageView; private BitmapFragment(int num){ super(); mPosition = num; } public ImageView getImageView(){ return mImageView; } /** * The Fragment's UI is just a Bitmap */ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_bitmap, container, false); try{ mImageView = (ImageView) v.findViewById(R.id.bitmap); mImageView.setImageBitmap(bitmap); } catch(Exception e){ e.printStackTrace(); } return v; } } private void changeImage() { /* BitmapFragment bf = new BitmapFragment(mCurrentPageIndex); FragmentTransaction ft = mReaderViewHandler.getSupportFragmentManager().beginTransaction(); ft.replace(R.layout.fragment_bitmap, bf); ft.commit(); */ ImageView v = getImageViewAtPage(mCurrentPageIndex); try { v.setImageBitmap(bitmap); } catch (Exception e) { e.printStackTrace(); } v.invalidate(); } </code></pre>
java android
[1, 4]
4,748,328
4,748,329
JQuery & Objects, trying to make a lightweight widget
<p>Trying to make a make generic select "control" that I can dynamically add elements to, but I am having trouble getting functions to work right.</p> <p>This is what I started with.</p> <pre><code>$select = $("&lt;select&gt;&lt;/select&gt;"); $select.addOption = function(value,text){ $(this).append($("&lt;option&gt;&lt;/option&gt;").val(value).text(text)); }; </code></pre> <p>This worked fine alone but anytime <code>$select</code> is <code>.clone(true)</code>'ed the <code>addOption()</code> function is lost. </p> <p>This is my object approach but still the function does not work.</p> <pre><code>function $selectX() { return $("&lt;select&gt;&lt;/select&gt;"); } $selectX.prototype.addOption() = function(value,text){ $(this).append($("&lt;option&gt;&lt;/option&gt;").val(value).text(text)); }; </code></pre> <p>Hack solution is to add the function manually after creation:</p> <pre><code>$nameSelect= new $selectX; $nameSelect.addOption = function(value,text){ $(this).append($("&lt;option&gt;&lt;/option&gt;").val(value).text(text)); }; </code></pre> <p>Am I barking up the wrong tree?</p>
javascript jquery
[3, 5]
5,521,329
5,521,330
Cannot create an instance of the abstract class or interface 'System.Drawing.Image'
<pre><code>Image img = new Image(); img.ImageUrl = "images/sample1.jpg?rnd=" + (new Random()).Next(); // added random for caching issue. this.Controls.Add(img); </code></pre> <p>I get the error as</p> <blockquote> <p>Cannot create an instance of the abstract class or interface 'System.Drawing.Image' --->Line 1</p> <p>'System.Drawing.Image' does not contain a definition for 'ImageUrl' and no extension method 'ImageUrl' accepting a first argument of type 'System.Drawing.Image' could be found (are you missing a using directive or an assembly reference?) ---> Line2</p> <p>The best overloaded method match for 'System.Web.UI.ControlCollection.Add(System.Web.UI.Control)' has some invalid arguments ---> Line3</p> <p>Error 10 Argument '1': cannot convert from 'System.Drawing.Image' to 'System.Web.UI.Control' </p> </blockquote> <p>Please help me to solve the error.</p>
c# asp.net
[0, 9]
3,669,213
3,669,214
jQuery hide li elements, then fade in on button hover
<p>I have a standard <code>ul</code> list which contains five <code>li</code> elements. After the third element, I've placed a button in the list with the CSS class <code>.morecats</code>. </p> <pre><code>&lt;ul&gt; &lt;li&gt;1&lt;/li&gt; &lt;li&gt;2&lt;/li&gt; &lt;li&gt;3&lt;/li&gt; &lt;button class="morecats"&gt;+&lt;/button&gt; &lt;li&gt;4&lt;/li&gt; &lt;li&gt;5&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Using jQuery, I have hidden the first three <code>li</code> elements:</p> <pre><code>$('ul') .find('li:gt(3)') .hide() .end(); </code></pre> <p>Now, I'd like jQuery to fade in and show the hidden <code>li</code> elements when the user hovers over the button <code>.morecats</code>. I'd also like a separate div called <code>.bg</code>to fade in/appear. </p> <p>How could this be accomplished?</p>
javascript jquery
[3, 5]
1,853,936
1,853,937
Why can't I call a form content?
<p>I have this simple code:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;form name="f1"&gt; &lt;asp:Label name="lbl" runat="server" Text="Label" onclick="lblClick()"&gt;&lt;/asp:Label&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; function lblClick(){ document.f1.lbl.text="new text";} &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>It doesn't work, it gives me: Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object ... , I can't even change the label text ....why?!!!</p>
asp.net javascript
[9, 3]
1,441,792
1,441,793
how to make a jquery hint password with asterisks
<p>example: <a href="http://jsfiddle.net/na2tD/" rel="nofollow">http://jsfiddle.net/na2tD/</a></p> <p>currently the password is not asterisks as 'type' for password text field needs to be type="text" so it cannot be changed to type="password" which is needed if i want asterisks. How do I get both jquery hint and asterisks working together</p>
javascript jquery
[3, 5]
3,947,216
3,947,217
Equivalent of Runtime class (of java) in c#
<p>Is their is an Equivalent of Runtime class (of java) in c# Actually I am trying to convert these operation to c#</p> <p>Runtime runtime = Runtime.getRuntime(); return runtime.totalMemory() - runtime.freeMemory();</p>
c# asp.net
[0, 9]
2,735,562
2,735,563
Session Timeout Add to QueryString
<p>I have an web app in C# and after 20 mins the session times out. I can't change this because other apps use the same config.</p> <p>So I am checking to see if the Session is NULL and if it is. It redirect and adds a QueryString with the Session ID. The problem I am having is when the Session times out the SessionID because NULL. Is there anyway to still get the sessionid after the timeout?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
4,431,294
4,431,295
How to change value from one Select to another?
<p>I have two Selects with several options in html code:</p> <pre><code>&lt;select name="t" id="t"&gt; &lt;option value="0"&gt;Overall&lt;/option&gt; &lt;option value="1"&gt;t_name&lt;/option&gt;&lt;/select&gt; &lt;select name="m" id="m"&gt; &lt;option value="0"&gt;back to Overall&lt;/option&gt; &lt;option value="1"&gt;m_some&lt;/option&gt;&lt;/select&gt; </code></pre> <p>And my question is how to force change value from first Select named "t" to "0" (Overall) only in the case when user chosen value "0" (back to Overall) in second Select named "m"? And submit form at the end. </p> <p>--EDIT--</p> <p>Now because of advices I tried do that in this way:</p> <pre><code>&lt;script&gt; $(function(){ $('#m, #t').change(function(){ if($('#m').val() == '0') $('#t').val('0').change(); $('form#myform').submit(); }); }); &lt;/script&gt; </code></pre> <p>And this script submits the form everytime when I change Select "m" or "t", except situation when I change Select "m" to value "0" (script only changes "t" to "0" in correct way without submit). Why?</p>
javascript jquery
[3, 5]
764,466
764,467
How to run asp.net application
<p>How to run asp.net application with encrypted web.config ,is it possible note that ASP.NET application have a database with encrypted connectionstring and a "cannot read connection string " message is generated </p>
c# asp.net
[0, 9]
2,484,468
2,484,469
Document.ready function
<p>I have some code in the - <code>$(document).ready(function()</code>{ - that shuffles stuff around, the code is fired when the page is loaded but what I want to do is add a button so this function runs every time I press the button, how could I achieve this, thanks??</p>
javascript jquery
[3, 5]
31,648
31,649
Fastest path to Android development for a non-Java programmer
<p>The decision to jump on the Android bandwagon has been made. The entire development environment has been installed and configured properly. I went through the steps suggested in <a href="http://developer.android.com/sdk/installing.html" rel="nofollow">http://developer.android.com/sdk/installing.html</a> and even managed to "write" the Hello World application and run it on the emulator. :)</p> <p>Unfortunately, however, I am not an experienced Java programmer and so, despite successfully completing all the suggested steps, and consulting an excellent speedy <a href="http://triton.towson.edu/~mzimand/os/Lect2-java-tutorial.html" rel="nofollow">Java tutorial for C++ programmers</a>, I feel that a lot is missing on the way to mastering Android development.</p> <p>It would have been great to first master the Java world (note: I didn't say language, as Java is so much more than just syntax), then delve into Android, but in the real world there are deadlines to meet and so starting to develop/learn directly on Android is very tempting...</p> <p>My question: Is it possible to develop good Android code while skipping the step of being an experienced Java programmer?</p> <p>Do you know of a fast track that allows mastering both?</p>
java android
[1, 4]
2,005,617
2,005,618
run .msi setup file after accessing web site from server to client
<p>I have created a web application in ASP.NET, with C#. I am getting the following message in my browser window when accessing the application: </p> <pre><code>--------------------------- Windows Internet Explorer --------------------------- Stop running this script? A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer might become unresponsive. </code></pre> <p>I researched into the problem and found the following link, which is proposed as a solution to this problem:</p> <p><a href="http://support.microsoft.com/kb/175500#FixItForMeAlways" rel="nofollow">http://support.microsoft.com/kb/175500</a></p> <p>I want to execute this setup when a client accesses the web site for the first time. How can I run this setup on the client side? </p>
c# asp.net
[0, 9]
202,673
202,674
Open A Contact Activity of Android with some fields which are already inserted
<pre><code>ArrayList&lt;ContentValues&gt; data = new ArrayList&lt;ContentValues&gt;(); ContentValues row1 = new ContentValues(); row1.put(Data.MIMETYPE, Organization.CONTENT_ITEM_TYPE); row1.put(Organization.COMPANY, "Android"); data.add(row1); ContentValues row2 = new ContentValues(); row2.put(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE); row2.put(Email.TYPE, Email.TYPE_CUSTOM); row2.put(Email.LABEL, "Green Bot"); row2.put(Email.ADDRESS, "[email protected]"); data.add(row2); Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI); intent.putParcelableArrayListExtra(Insert.DATA, data); startActivity(intent); </code></pre> <p>I did not find it in android.provider.ContactsContract.Intents.Insert.Data (which is using in second last instruction) there is no Data Variable in Insert Class , I am using API-8 v2.2 Please help is their any other way to do this ? I want to fill the data in add contact like this.</p>
java android
[1, 4]
734,147
734,148
Duplicate cookie with same name creates undesired behaviour
<p>Hi I am trying to save browser state by storing it into a cookie.For some reason this does not seem to always work how I want it because it creates a duplicate cookie with the same name.Here is what I mean:</p> <p><img src="http://i.stack.imgur.com/FBWUF.png" alt="enter image description here"></p> <p>This is the only code I am using to work with cookies:</p> <pre><code>$(function () { var content = $("#content"); var state = $.cookie("layoutState"); if (state === "grid") { content.removeClass("content-list").addClass("content-grid"); } if (state === "list") { content.removeClass("content-grid").addClass("content-list"); } $("#list").on("click", function (e) { $.cookie("layoutState", "list", { expires: 7, path: "/" }); content.removeClass("content-grid").addClass("content-list"); e.preventDefault(); }) $("#grid").on("click", function (e) { $.cookie("layoutState", "grid", { expires: 7, path: "/"}); content.removeClass("content-list").addClass("content-grid"); e.preventDefault(); }) </code></pre> <p>})</p> <p>I am using jQuery cookie plugin.</p> <p>Does anyone understand what the problem is I have been trying to solve it for hours with no luck?</p>
javascript jquery
[3, 5]
2,196,127
2,196,128
how to format number the using jquery
<p>I am trying to remove the number which are coming after "." then i want to format the number <strong>(16810900.211233)</strong> to like this <strong>(16,810,900)</strong> but i dont know how to do that here is my html is this:</p> <pre><code>&lt;link rel="stylesheet" type="text/css" href="http://cdn.webrupee.com/font" /&gt; &lt;div class="main"&gt; &lt;p class="active"&gt;10200.00&lt;/p&gt; &lt;p class="in_active"&gt;16810900.211233&lt;/p&gt; &lt;p class="active"&gt;0&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;1278200.543554&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;-&lt;/p&gt; &lt;p class="in_active"&gt;9,890.656&lt;/p&gt; &lt;p class="active"&gt;10,200&lt;/p&gt; &lt;p class="in_active"&gt;16810900&lt;/p&gt; &lt;p class="active"&gt;0&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;1278200.09&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;-&lt;/p&gt; &lt;p class="in_active"&gt;9890.00&lt;/p&gt; &lt;/div&gt;​ </code></pre> <p>i tried here <a href="http://jsfiddle.net/sureshpattu/Hrac3/2/" rel="nofollow">jsfiddle</a></p>
javascript jquery
[3, 5]
2,495,775
2,495,776
Writing to a label from a static function
<p>I'm trying to do something that I thought would be easy but can't figure out how to write to a label inside my stating function.</p> <pre><code>public static void StartProcessing(object data) { lblError.Text = "Blah Blah" } </code></pre> <p>I get the error "An object reference is required for the non-static field, method, or property..."</p> <p>So I tried creating a new instance of the label and adding it to a new instance of a control (Panel) but the lblError isn't getting displayed</p> <pre><code> public static void StartProcessing(object data) { Panel Panel1 = new Panel(); Label lblError= new Label(); Panel1.Controls.Add(lblError); lblError.Visible = true; lblError.Text = "Blah Blah"; } </code></pre> <p>there must be an easy way to do this? Which i've overlooked..</p> <p>The function is getting called as follows: If I change the above to not be static I get an error message on the second line below saying the same "An object reference is required for the non-static field, method, or property..." When this function isn't static?</p> <pre><code>public object LaunchNewProcess(object data) { ThreadPool.QueueUserWorkItem( new WaitCallback(ProcessStatuses.StartProcessing), new object[] {newProcess, allProcesses} ); </code></pre>
c# asp.net
[0, 9]
2,326,912
2,326,913
count down not working fine in IE
<p>i m running a count down for the deals page in my project it is working fine in chrome and Firefox but in IE it gives NAN on every box of my code is as in c the value is; the link of my project is <a href="http://blog.merimobiles.com/deals/customer.php" rel="nofollow">http://blog.merimobiles.com/deals/customer.php</a> var c = '02 28 2013, 23:59:59'; </p> <pre><code>var count=0; $(document).ready(function () { var c = &lt;?php echo $date ;?&gt;; $('#superoffer'+count).epiclock({mode: $.epiclock.modes.countdown, time: new Date(c)}); count++; }); </code></pre> <p><img src="http://i.stack.imgur.com/ZCpYi.jpg" alt="enter image description here"></p>
php javascript
[2, 3]
5,534,465
5,534,466
Retrive value of cookie from another page in javascript or jquery
<p>I am working on a form <a href="http://evmyf.vzhgw.servertrust.com/Articles.asp?ID=257" rel="nofollow">http://evmyf.vzhgw.servertrust.com/Articles.asp?ID=257</a></p> <p>On the form i have a link called upload logo. it opens a window to upload an image i have stored the image name that is uploaded in the window in a cookie . the cookie name is UploadFile. i want retrieve the value of the cookie on the link i mentioned above. How can i do it.Please advise.</p> <p>On the upload logo page that is the new window. i have created the cookie and stored its value using following code in ASP.</p> <pre><code>Response.Cookies("UploadFile")=File.FileName fname=Request.Cookies("UploadFile") response.write("UploadFile=" &amp; fname) </code></pre>
javascript jquery
[3, 5]
667,463
667,464
How to activate DevicePolicyManager in android implicitly?
<p>well once you get the necessary classes and instantiate the DevicePolicyManager,ActivityManager and ComponentName</p> <p>when i try to enable it using an intent call, it shows me an info screen about this to Activate or Cancel in which i wanted to have it activated already without the user's permission.</p> <p>is there a work-around with this?</p>
java android
[1, 4]
4,616,820
4,616,821
LINQ / LAMBDA expression for the below code
<p>I am having a checked list box from which i extracted the checked items value and saved it to database. Now when i am returning back to form i am having only the value [id] as a List. Now i want to display those selected values from this list of int.</p> <p>I think i am clear to you. </p> <p><strong>[Update]</strong></p> <p>Hi, I solved my issue , using the below code. But i want to know is there any more optimized solution than this one. As its iterating unneccesarily</p> <pre><code>private void ProcessRequest() { if (Session["DeniedReason"] != null) { List&lt;int&gt; deniedList = (List&lt;int&gt;)Session["DeniedReason"]; if(deniedList!=null) { if(deniedList.Count&gt;0) { foreach (int deniedValue in deniedList) { foreach (ListItem item in cblDeniedList.Items) { if (string.Compare(item.Value,deniedValue.ToString())==0) { item.Selected = true; } } } } } } } </code></pre> <p>LINQ / Lambda expression if any..that would be great.</p>
c# asp.net
[0, 9]
1,081,498
1,081,499
using .ajax() in .each()
<p>I'm trying to iterate through elements of .ball class and check if their associated url exists:</p> <pre><code>$(".ball").each(function(i){ var url; var c_day = $(this).data('day'); var c_mon = $(this).data('mon'); var c_year = $(this).data('year'); url = c_year + "/" + c_mon + "/" + c_day + ".html"; $.ajax({ url: url, error: function() { alert('file: ' + url + ' does not exist'); }, success: function() { alert('file: ' + url + 'EXXXXXXISTS!!!!!'); blogA[ blog_count ] = url; blog_count++; $(this).css("color", "red" ); } }); }); </code></pre> <p>I've done some research and read that using .ajax in .each causes a lot of problems but I couldn't wrap my head around on how to fix it.</p> <p>The problem is that I get really weird results (has to do with asynchronous?). If I alert url outside of ajax, it correctly iterates through the elements. If I alert url in ajax, it spits out urls that belong to the last element of the class.</p>
javascript jquery
[3, 5]
3,536,269
3,536,270
JavaScript to PHP translation
<p>not familiar with PHP as I'm with JavaScript so maybe you can help translating the following code to PHP.</p> <pre><code>&lt;script type="text/javascript"&gt; var d=new Date(); var weekday=new Array(7); weekday[0]="Sunday"; weekday[1]="Monday"; weekday[2]="Tuesday"; weekday[3]="Wednesday"; weekday[4]="Thursday"; weekday[5]="Friday"; weekday[6]="Saturday"; document.write("Hurray! It's " + weekday[d.getDay()]); </code></pre> <p></p>
php javascript
[2, 3]
2,142,226
2,142,227
Javascript Class - Cannot set a property
<p>I have the below code to create a class in javascript.... Now i will only pass the ID of the 'website' and then via an ajax call i will get the rest of the information from the database (JSON ENCODED).</p> <p>Now my only problem is that when i see whats in the object at the end its only showing the id.</p> <p>The ajax calls works fine because if i alert this.address after success (ajax) its displaying the result.</p> <p>What I presume is that I cannot set a property with an ajax request... Can you help?</p> <pre><code>function website(id) { this.id = id; //id $.ajax({ //website_information type: "GET", url: '/proc.php?proc=website_name&amp;id=' + this.id + '', success: function(data){ var tmp = $.parseJSON(data); this.address = tmp.website_address; this.name = tmp.website_name; } }); } var obj = new website('20'); obj.alertwebsite(); console.log(obj); </code></pre>
javascript jquery
[3, 5]
2,115,263
2,115,264
2-dimensional array with duplicated index key
<p>i want to translate this line of code from php to asp.net </p> <pre><code>$subid[$value['parentid']][] = $value['id']; </code></pre> <p>i'm not familiar with asp.net data structure, i've tried arraylist but can't insert at [1], dictionary do not allow duplicated keys, anyone have ideas?</p> <p>thanks</p>
c# asp.net
[0, 9]
3,548,615
3,548,616
Shared Preferences aren't setting up
<p>I am using following code in the start of my activity</p> <pre><code> ArrayAdapter&lt;String&gt; spinnerArrayAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, transferToOrFromArray); spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); transferTo.setAdapter(spinnerArrayAdapter); transferFrom.setAdapter(spinnerArrayAdapter); SharedPreferences CNPASettings = getSharedPreferences("CNPA",0); transferTo.setSelection(spinnerArrayAdapter.getPosition(CNPASettings.getString("transferTo",spinnerArrayAdapter.getItem(0)))); transferFrom.setSelection(spinnerArrayAdapter.getPosition(CNPASettings.getString("transferFrom",spinnerArrayAdapter.getItem(0)))); </code></pre> <p>When i complete doing stuff, i press Done button which contain following code.</p> <pre><code> title = "Success"; error = "Transfer has been done"; SharedPreferences CNPASettings = getSharedPreferences("CNPA",0); SharedPreferences.Editor prefEditor = CNPASettings.edit(); prefEditor.putString("tranferFrom", transferFrom.getSelectedItem().toString()); prefEditor.putString("tranferTo", transferTo.getSelectedItem().toString()); prefEditor.commit(); finish(); </code></pre> <p>But whenver i create the activity again, it passes default values <code>spinnerArrayAdapter.getItem(0))</code></p> <p>What am i doing wrong?</p>
java android
[1, 4]
736,147
736,148
how to create java zip archives with a max file size limit
<p>I need to write an algorithm in java (for an android app) to read a folder containing more folders and each of those containing images and audio files so the structure is this: <code>mainDir/subfolders/myFile1.jpg</code></p> <ul> <li><sup>It must be in java, something like perl script is not an option. It would preferably be for the compressed archive in order to squeeze as many files as possible before mailing the zip. Just a normal zip (no jar).</sup></li> </ul> <p>My problem is that I need to limit the size of the archive to 16mb and at runtime, create as many archives as needed to contain all my files from my main <code>mainDir</code> folder. I tried several examples from the net, I read the java documentation, but I can't manage to understand and put it all together the way I need it.</p> <p>Has someone done this before or has a link or an example for me? I resolved the reading of the files with a recursive method but I can't figure the logic for the zip creation.</p> <p><strong>EDIT:</strong> <a href="http://stackoverflow.com/questions/11084823/filenotfoundexception-no-such-file-or-directory">FileNotFoundException (no such file or directory)</a> this was my initial post at Stack Overflow. I've got an answer to it, but I can't set the size of the ZipEntry and the logic doesn't work and also when extracting the my files from the zip I get the <code>compression method not supported</code> error.</p>
java android
[1, 4]
974,423
974,424
How to share variables between classes in java
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2965109/passing-data-between-activities-in-android">Passing data between activities in Android</a> </p> </blockquote> <p>so I have two activity's, and I need to save one variable in first activity, and use it in the second activity. Can anyone help me? Thanks!</p>
java android
[1, 4]
1,438,126
1,438,127
How can i pass parameter from javascript to generic handler?
<p>I called generic handler (ashx) from javascript code as given below; </p> <pre><code>var xmlHttpReq = createXMLHttpRequest(); xmlHttpReq.open("GET", "hndlrCars.ashx, false); xmlHttpReq.send(null); xmlText = xmlHttpReq.responseText; </code></pre> <p>But i have to pass parameter (dropdown selectedvalue) from .aspx to generic handler's "ProcessRequest" method.How can i do this?</p>
c# javascript asp.net
[0, 3, 9]
4,388,579
4,388,580
Share business logic in asp.net (c#) and android (java)
<p>I'm working on a project that has a website (asp.net c#) and android app (java) that share some common functionality. Currently when they need to use the same business logic the android makes a call to the website and gets the results. We've had a request for the android to work "offline", so it would need to perform that business logic without hitting the website. Are there any ways to do that?</p> <p>The only thing we've thought of so far are using javascript, as a node.js server for asp.net to hit and rhinoscript to include in the java. This will work, but I was hoping for a less complex (not having to run node.js and .net servers).</p> <p>An example of the logic needed is passing in a couple of products and calculating discounts, taxes, etc to return the total price. It's a bit more complex than that, but not too much.</p>
java android asp.net
[1, 4, 9]
5,690,716
5,690,717
ArrayList to String - VS2008 - C#
<pre><code> ArrayList filters = new ArrayList(); filters.Add(new string[] { "Name", "Equals", "John" }); ObjectDataSource1.SelectParameters.Add("AppliedFilters", string.Join(",",(string[])filters.ToArray(typeof(string)))); </code></pre> <p>Am trying to add a parameter to my object data source which is bound to my select method which should accept a string[]. But as the SelectParameters.Add takes in (string,string) or the other 3 overloads which do not seem to function for me correctly. </p> <p>The select method accepts a string param though i prefer it accept a string[] or arraylist, but for now I can live with accepting a string which i should convert back to string[]</p> <p>Resolution: followed this article <a href="http://stackoverflow.com/questions/235166/how-do-i-set-up-objectdatasource-select-parameters-at-runtime">link text</a></p> <p><strong>Closed</strong> as duplicate of the question referenced above.</p>
c# asp.net
[0, 9]
1,457,287
1,457,288
How can I play a sound after a query?
<p>I have a store and I want to play a sound just after receiving an order. I store my orders in my database so I want to play a sound after running this check order query:</p> <pre><code>$order_check_query("SELECT * FROM orders WHERE status = 'pending'"); </code></pre> <p>I want to run this query every 5 minutes when I am logged in. If there are any pending orders I want to play a sound for 30 sec to notify me.</p>
php javascript
[2, 3]
2,088,454
2,088,455
Get image width and height
<p>I need to get an image's dimensions in javascript (jQuery) when no styles are specified for it (jQuery's css() returns 0).</p> <p>Maybe it is because I'm loading the image with jQuery just before asking for its dimensions. If this is the case, is there any event to listen that tells when the image has been loaded?</p>
javascript jquery
[3, 5]
866,527
866,528
write in file permission in android
<p>i want to write in a file by using the following:</p> <pre><code> BufferedWriter buf = new BufferedWriter(new FileWriter("test2")); buf.write(mytext); buf.close(); </code></pre> <p>but i got this message (file test2 read only)</p> <p>how can i get the write permission</p>
java android
[1, 4]
2,396,219
2,396,220
How to Add an HREF using Javascript?
<p>I have an ASP.NET 4.0 site that has links to another ASP.NET site (different domain name). In situations where users from domain 1 are directed to a page on domain 2, how would I setup a Javascript routine to create an href back to domain 1? That is, I don't want to place a solid <code>&lt;a&gt;</code> tag on domain 2 pointing back to domain 1. Rather, I need a little bit of script magic that only makes the href available to users coming from domain 1. Can anyone suggest a specific Javascript library/widget that functions in this manner?</p>
javascript asp.net
[3, 9]
4,020,661
4,020,662
setInterval interfering with hide()
<p>I recently implemented a loading image and noticed that ever 10 seconds, that the loading image appears for a split second then disappears again. I've traced it to this code. When I comment this out, the loading image never appears until it is supposed to. I'm using the setInterval code globally so is there something that I can do to get these two things working nicely together?</p> <p>I want to stop the loading image from appearing for a brief second.</p> <pre><code> var auto_refresh = setInterval( function() { .... }, 10000 ); </code></pre>
javascript jquery
[3, 5]
4,228,924
4,228,925
how to create a cross-browser compatible "spotlight" effect?
<p>i found a spotlight plugin for Jquery, but it is not functional in IE.</p> <p>so is there a way to make the rest of the background fade to a dark color while selected or element of focus remains the same ?</p>
javascript jquery
[3, 5]
219,709
219,710
reorder list elements - jQuery?
<p>Is it possible to reorder <code>&lt;li&gt;</code> elements with JavaScript or pure jQuery. So if I have a silly list like the following:</p> <pre><code>&lt;ul&gt; &lt;li&gt;Foo&lt;/li&gt; &lt;li&gt;Bar&lt;/li&gt; &lt;li&gt;Cheese&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How would I move the list elements around? Like put the list element with <code>Cheese</code> before the list element with <code>Foo</code> or move <code>Foo</code> to after <code>Bar</code>. </p> <p>Is it possible? If so, how?</p>
javascript jquery
[3, 5]
5,048,449
5,048,450
How to get the selected-row count from a list box in asp.net
<pre><code>int countSelected = ListBoxMembers.Items.Cast&lt;ListItem&gt;().Where(i =&gt; i.Selected).Count(); string groupName = txt_GroupName.Text; for (int counter = 0; counter &lt; ListBoxMembers.Items.Count; counter++) </code></pre> <p>I have 20 items in the list, when I select only 2 ListBoxMembers.Items.Count shouws 20 and Countselected is 0</p> <p>i tried this int count = ListBoxMembers.GetSelectedIndices().length; system.web.ui.controls.listbox does not contain a definition for selected items and no extension method selevted items acceptin first argument error</p> <pre><code> &lt;asp:ListBox ID="ListBoxMembers" runat="server" SelectionMode="Multiple" CssClass="style102" ToolTip="Press ctrl to select multiple users" DataValueField="FirstName"&gt;&lt;/asp:ListBox&gt; </code></pre>
c# asp.net
[0, 9]
4,691,687
4,691,688
Viewing of Word file in browser
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5001497/word-document-viewer-browser-plugin">word document viewer browser plugin</a> </p> </blockquote> <p>I wan to view the user uploaded docx file on front end (browser). Any recommendation for jQuery or in flash or in PHP . </p> <p>Thanks. </p>
php jquery
[2, 5]
1,401,892
1,401,893
Add Dynamic CheckBox Handle CheckedChanged Event ASP.NET
<p>plz help me the event is not firing &amp; how can i find which check box control fired event</p> <pre><code>chkList1 = new CheckBox(); chkList1.Text = row["subj_nme"].ToString(); chkList1.ID = row["subjid"].ToString(); chkList1.Checked = true; chkList1.Font.Name = "Verdana"; chkList1.Font.Size = 12; chkList1.AutoPostBack = true; chkList1.CheckedChanged += new EventHandler(CheckBox_CheckedChanged); Panel1.Controls.Add(chkList1); protected void CheckBox_CheckedChanged(object sender, EventArgs e) { Label1.Text = "Called"; } </code></pre>
c# asp.net
[0, 9]
1,673,040
1,673,041
jQuery: making a textarea slide out when rows are changed?
<p>I have a text area box that expands from 3 to 17 rows when the user enters so many characters as well as on a button click.</p> <p>SetNewSize(); function is the called via onkeyup and expands the text area when the length becomes greater than 50.</p> <p>morespace(); function is called via the button. </p> <p>I would like to slide the box out when this happens, any ideas?</p> <p>Thanks here is my code:</p> <pre><code>function SetNewSize(textarea){ if (textarea.value.length &gt; 50) { textarea.rows = 17; } else { textarea.rows = 3; }} function morespace(){ var thetxt = document.getElementById('more').value; var box = document.forms["myForm"]["comment"]; if(box.rows == 3) { $("#emailme").fadeOut(800); box.rows = 17; document.getElementById('more').innerHTML = "less space?"; } else { $("#emailme").fadeIn(800); box.rows = 3; document.getElementById('more').innerHTML = "more space?"; }} </code></pre>
javascript jquery
[3, 5]
891,654
891,655
Does the Motorola Xoom have drawing bugs, or is it just me?
<p>I've developed a little game and a friend/colleague of mine tried it on his Motorola Xoom tablet, only to find the rendering was all messed up! I stripped everything down trying to simplify everything to see what was wrong, and I'm thinking the Motorola Xoom is just buggy when it comes to drawing. The exact same APK was used on both, with the exact same drawing code. I've got a custom view that's just drawing a black rectangle right now, like so:</p> <pre><code>@Override public void draw(Canvas canvas) { super.draw(canvas); canvas.save(); canvas.scale(16.0f, 16.0f); float lineWidth = 20 / 16.0f; paint.setAntiAlias(false); paint.setStyle(Paint.Style.STROKE); paint.setStrokeWidth(lineWidth); paint.setColor(boardColor); // boardColor is just black canvas.drawRect(100 / 16.0f, 100 / 16.0f, 200 / 16.0f, 200 / 16.0f, paint); canvas.restore(); } </code></pre> <p>On my Sprint Galaxy SII, Android 4.0.4, I get (I also get this on a Galaxy SIII device): <img src="http://i.stack.imgur.com/TGyES.png" alt="Galaxy SII screenshot"></p> <p>On my friends Motorola Xoom, Android 4.1.2, I get: <img src="http://i.stack.imgur.com/HEeDW.png" alt="Motorola Xoom screenshot"></p> <p>All I want it is a correctly sized, non-antialiased rectangle. What am I doing wrong? Or is it the Xoom?</p>
java android
[1, 4]
3,890,567
3,890,568
How do I allow to check only one checkbox out of four in UserControl?
<p>I have created a User Control with 4 check boxes(server control).I want to allow to check only one checkbox out of four.</p> <p>The user control is loaded on page dynamically.I page may have multiple same UserConrol.</p> <p>How do I do it using Jquey or Javascript?</p>
javascript asp.net jquery
[3, 9, 5]
1,667,221
1,667,222
Apply class to body while watching videos
<p>Is there a way to first check if the browser is webkit or not, and then apply a class to the body when a user clicks on a video to play it? If the browser is webkit, I'd like to apply the class .blur, and if the browser is not webkit, i'd like to add a dark overlay, so the user can focus on the video. I would have NO clue whatsoever how to do this except for apply the blur, hehe. Any help would be awesome!</p>
javascript jquery
[3, 5]
2,772,000
2,772,001
How to get the my table size after applying css styles
<p>i am having one div, which contains one table. i want to apply the table-width to div element. My table cells having padding 5, so table width is not correct in IE browser, while the mozila the sample code works.</p>
javascript jquery
[3, 5]
853,640
853,641
Display Gridviews with data at a time
<p>I am working in C#.Net and have a page with five gridviews. Once I run the application, all the five grids should be displayed with data at a time. But now, one by one is loading and displaying. </p> <p>How to display all the gridview at a time? Whether I should do anything in page render.</p> <p>Here is my Page_Load..</p> <pre><code>gridview1.DataSource = ds1.Tables[0]; gridview1.DataBind(); gridview2.DataSource = ds2.Tables[0]; gridview2.DataBind(); gridview3.DataSource = ds3.Tables[0]; gridview3.DataBind(); gridview4.DataSource = ds4.Tables[0]; gridview4.DataBind(); gridview5.DataSource = ds5.Tables[0]; gridview5.DataBind(); </code></pre> <p>First two grids had less amount of data. so it got quickly laoded in the output page. when coming to 3rd grid, it had large amount of data, at that time the output page looks with first two gridviews and waiting for the 3rd grid. </p> <p>What i want is, once i run the application all the five grids should get displayed at a time..</p>
c# asp.net
[0, 9]
4,290,471
4,290,472
facebook app is not redirecting to login url so unable to open popup
<p>After login app it doesn't given allow popup from facebook window. Currently it is giving allow popup when open from published url I think its not redirect to redirecturl in facebook aap but redirects it from localhost.</p> <pre><code>string facebookAppId = System.Configuration.ConfigurationManager.AppSettings["FacebookAppId"]; string Curl = "https://publishedurl"; string ClientSecret = System.Configuration.ConfigurationManager.AppSettings["FacebookSecretKey"]; string currenturl = HttpContext.Current.Request.Url.AbsoluteUri; string redirectpath = "https://graph.facebook.com/oauth/authorize?client_id=" + facebookAppId + "&amp;redirect_uri=" + Curl + "&amp;scope=read_stream,offline_access,publish_actions,email"; ClientMessageBox.Show(redirectpath, this); Response.Redirect(redirectpath, false); if (!currenturl.Contains(MessageClass.URLCODE)) { Response.Redirect(@"https://graph.facebook.com/oauth/authorize?client_id=" + facebookAppId + "&amp;redirect_uri=" + Curl + "&amp;scope=read_stream,offline_access,publish_actions,email"); } </code></pre>
c# asp.net
[0, 9]
2,798,786
2,798,787
Need to add a fade out effect to a hiding box with javascript/jquery
<p>I have a notification div which dissapears after 5 seconds. How to add a fade out effect that the disappearing would be smooth and nice.</p> <p>My code now: </p> <pre><code>&lt;script type="text/javascript"&gt; setTimeout(function(){ document.getElementById('notification').style.display = 'none'; }, 5000); //5secs &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,614,380
1,614,381
Page_Load event not firing when using Response.Redirect()
<p>I have two forms in my web application (Page1 and Page2). Now Page1 is having a grid on whose row_command event i am going to Page2. And on load event of Page2 i am checking a condition which if false i am going to Page1 using Response.Redirect().</p> <p>Now when i am going from Page2 to Page1 the load event of Page1 is not getting fired. i have used cache clearing and response.end ,but its not helping. But when i am using Server.Transfer the load event of Page1 is getting fired.</p> <p>Awaiting for ur response .Guys</p>
c# asp.net
[0, 9]
4,067,462
4,067,463
Substring html tag using Javascript
<p>I want to sub string and remove the <code>,</code> which appears within the span tag and display the name alone. Below are the two cases which needs to work.</p> <pre><code>Case1: &lt;span class="datatableheader"&gt;No results found, &lt;/span&gt; Case2: &lt;span class="datatableheader"&gt;Jude Gomes, &lt;/span&gt; </code></pre> <p>A single function should help in removing the <code>,</code> in both cases and display the result as </p> <pre><code>&lt;span class="datatableheader"&gt;No results found &lt;/span&gt; &lt;span class="datatableheader"&gt;Jude Gomes &lt;/span&gt; </code></pre> <p>Appreciate for any help.</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,797,218
5,797,219
jquery submit form not calling button click event at server side
<p>i am using asp.net and following code to submit form on enter key press it is working but only refreshing same page and not calling button click event in server side code and without saving data it is comming back to same form, even without the jquery code again same thing happening don't know why but in some forms enter key press working fine and saving data without even following jquery code.</p> <pre><code>$(function() { $("form input").keypress(function (e) { if ((e.which &amp;&amp; e.which == 13) || (e.keyCode &amp;&amp; e.keyCode == 13)) { alert('Alert is Working but data is not being Save Only Refresh'); $('button[type=submit].default').click(); return false; } else { return true; } }); }); </code></pre>
jquery asp.net
[5, 9]
5,789,832
5,789,833
Image.FromFile with a username password. C#
<p>Ok we need to load a file on the network, (Files are stored seperatly from the webserver).</p> <p>Is there anyways we can specify a network userid a password when calling the function below?</p> <p>Image.FromFile("\IPADDRESSHERE\GroupPictures\");</p>
c# asp.net
[0, 9]
377,513
377,514
Wait for file to exist in ASP.NET
<p>I have an ASP.NET page, where the user is able to trigger a console app on our server, which generates a file. What I want is the user to see a message that states 'Requesting file', then as soon as the file becomes available (i.e. <code>File.Exists</code> for the file returns true), the Requesting file message will change to a link of the file.</p> <p>Is this easy to accomplish in ASP.NET?</p>
c# javascript asp.net
[0, 3, 9]
4,275,891
4,275,892
Unable to post values from a dynamic row containing a multiselect list box
<p>I am able to dynamically create a multiple list box but I cannot post the values. The select element is a 2 dimensional array and I am not getting any values returned from the options.</p> <p>Here is my javascript code:</p> <pre><code>function createSelectCell(cell,column,multiselect_type_flag) { var copyListBox = document.getElementById(column); var newListBox = document.createElement('select'); if(multiselect_type_flag == 'F') { newListBox.name = 'column_array_'+column+'[]'; } else if(multiselect_type_flag == 'T') { newListBox.name = 'column_array_'+column+'[][]'; newListBox.size = '4'; newListBox.setAttribute('multiple', 'multiple'); } for (var i = 0; i &lt; copyListBox.options.length; i++) { var newOption = document.createElement("option"); newOption.text = copyListBox.options[i].text; newOption.value = copyListBox.options[i].value; newListBox.appendChild(newOption); } cell.appendChild(newListBox); } </code></pre> <p>Requested for html in comments:</p> <pre><code>echo "&lt;td&gt;&lt;select id='".$column."' name='column_array_".$column."[$i][]' multiple='multiple' size='4'&gt;"; </code></pre> <p>When I do <code>print_r($_POST['column_array_'.$column]);</code> I get:</p> <pre><code>Array ( [0] =&gt; Array ( [0] =&gt; Secondary Contact ) [1] =&gt; Array ( [0] =&gt; Authorised to log calls ) ) </code></pre> <p>when I should be getting: </p> <pre><code>Array ( [0] =&gt; Array ( [0] =&gt; Secondary Contact [1] =&gt; Authorised to log calls ) ) </code></pre>
php javascript
[2, 3]
2,550,582
2,550,583
SCRIPT5007: Unable to get value of the property 'call': object is null or undefined
<p>Today i run my app on IE9 and a very strange error occurred (shown in image). The exception is generating continuously whenever i click on the page any where. Can please anybody tell me what can cause this exception ?</p> <p><img src="http://i.stack.imgur.com/ce8Qg.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
2,528,113
2,528,114
How to get an element with jquery that has an illegal character in the id?
<p>A third-party control creates an element with an id that looks like:</p> <pre><code> aspxgv_1803_0_cell1_9_Attribute1^ubd </code></pre> <p>I need to get the value of this element but jquery seems to have issues with the illegal "^" in the id.</p> <pre><code> var fieldId = 'aspxgv_1803_0_cell1_9_Attribute1^ubd'; var fieldValue = $('#' + fieldId).val(); // &lt;-------- function stops </code></pre> <p>How can I get the value of this element?</p>
javascript jquery
[3, 5]
531,367
531,368
Translate PHP function to jQuery
<p>I currently fetch a GET-param via PHP and run through at PHP funtion. Now I need that value for a jQuery script on the site. So how can I do the following in jQuery?</p> <pre><code>function trimQuery($query){ $query = trim($query); $query = preg_replace("/[^a-zåäö0-9\s]/i","",$query); return $query; } $trimmedQuery = trimQuery($_GET['q']); $arrayTrimmedQuery = explode(" ",trimmedQuery ); foreach(arrayTrimmedQuery as $value){ echo $value; } </code></pre>
php jquery
[2, 5]
4,513,343
4,513,344
How to read a AndroidManifest.xml (in binary) file?
<p>I am trying to read the content of the AndroiadManifest.xml file which seems to be in "DBase 3 data file" binary format.</p> <p>Is there any code example in Java on how to read this binary file? I don't need write, just read the text content.</p>
java android
[1, 4]
2,072,909
2,072,910
Limit Character count in c# String
<p>I have this code, is there an easy way to limit the amount of characters displayed to 250?</p> <pre><code>&lt;%# trimIt(DataBinder.Eval(Container.DataItem, "WebSalesText").ToString())%&gt; public string trimIt(string s) { if (s.Length &gt; 0 &amp;&amp; s.IndexOf(".") &gt; 0) { return (s.Substring(0, s.IndexOf(".")) + " ..."); } else { return s; } } </code></pre>
c# asp.net
[0, 9]
1,071,543
1,071,544
linkbutton click event
<p>I have dynamically added a linkbutton to the page. But the click event is not working. What could be the problem? Thanks for your help. I am adding a linkbutton on button click event. Here is my code.</p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { LinkButton lb = new LinkButton(); lb.Text = "dsadsa"; lb.ID = "22"; lb.CommandArgument = "22"; lb.CommandName = "22"; lb.Command += new CommandEventHandler(lb1_Command); PlaceHolder1.Controls.Add(lb); } protected void lb1_Command(object sender, CommandEventArgs e) { Label1.Text = e.CommandName; } </code></pre>
c# asp.net
[0, 9]
894,599
894,600
Android 2x2 rows of images that automatically scale
<p>I am looking for the best solution to create 2x2 rows that automatically scale. The problems I have faced so far, is the left image being full size, and the right being downsized a lot.</p> <p>The pictures will be 400x400 pixels, and need to be displayed probably on all devices.</p>
java android
[1, 4]