Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
3,652,120
3,652,121
RegisterStartupScript no longer working in asp.net
<p>Mostly my website is working with ajax, but if I need to send a message on page load I want it to be in the same style as everywhere else, so I am using the following method on my master page:</p> <pre><code>public void showWarning(String message) { Page.ClientScript.RegisterStartupScript(this.GetType(),"svrShowWarning","showWarning('" + message + "');",true); } </code></pre> <p>This was working fine, but recently it has stopped working (I don't know when, exactly.)</p> <p>The server simply fails to put the script on the page at all - looking at the page source in my web browser, I can see that the script is not present.</p> <p>Before, I had a form with a <code>runat=server</code> tag enveloping all the content on my master page, but I took this out. I wondered if this may be the cause?</p> <p>What is a good way to get some simple javascript like this to fire on my page, after everything has loaded?</p>
javascript asp.net
[3, 9]
1,809,010
1,809,011
PHP unserialize error when deserializing jQuery serialized form
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6164691/what-to-do-with-php-after-jquery-serialize">What to do with php after jquery .serialize()</a> </p> </blockquote> <p>I am serializing the following form using jQuery, sending it to the server using ajax and deserializing using PHP.</p> <p>When I deserializing I get the error:</p> <p><code>Error at offset 0 of 39 bytes</code></p> <pre><code>&lt;form id="Marriage" style="display: none"&gt; &lt;input type="text" name="city" class="txtt" value="city"/&gt; &lt;input type='button' value='Apply' id="msendsend" class="sendaf" name="jobforming"/&gt; &lt;/form&gt; </code></pre> <p>Here is the jquery function to send this form</p> <pre><code> $(document).ready(function () { $('#msendsend').click(function () { var id=getParam('ID'); $.ajax({ type:'POST', url:"send.php", data:{option:'apply', sr:$("form").serialize()}, success:function (jd) { } }); }); }); </code></pre> <p>This is the server code:</p> <pre><code> if($_REQUEST['option']=='catapply') { $sc=$_POST['sr']; mysql_query("insert into user_data(uid,data) values('$session-&gt;userid','$sc')"); } </code></pre> <p>And here I am unserializing .</p> <pre><code> $sql = mysql_query("SELECT * from user_data"); while ($row = mysql_fetch_array($sql)) { $un = unserialize($row['data']); $city=$un['city']; echo $city; } </code></pre> <p>The data in the database is shown as</p> <pre><code>to=&amp;select_category=25&amp;msg=&amp;city=laho </code></pre>
php jquery
[2, 5]
4,675,238
4,675,239
Jquery selected value of highlighted text
<p>Im trying to make my editor where when you highlight text on your computer, jquery will take that selected value and throw the tags around it, more specificity code or pre tags.</p> <pre><code> var Selectedvalue = // set highlighted selection value $("#content").contents().find("body").append($("&lt;pre&gt;&lt;/pre&gt;").append(Selectedvalue)) ; </code></pre> <p>I already know how to get the value between the tags, i just need to know how to get the value.</p>
javascript jquery
[3, 5]
4,052,838
4,052,839
how can we get dataset with generic handler or jquery from Database
<p>Like for a single value i easily work, or also true false condition. like getting a single value from database</p> <pre><code> string i = ""; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SelectPass"; cmd.Parameters.AddWithValue("@userID", context.Request.QueryString["id"]); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { i = reader["Password"].ToString(); } reader.Close(); conn.Close(); if (i == "") { context.Response.Write("False"); } else { context.Response.Write(i); } </code></pre> <p>and in client side easily showing the value in one variable.</p> <pre><code> function abc() { $.get('\HandlerResetPass.ashx?id=' + $('#txtUserId').val()+'&amp;lbl='+ $('#lblPasswo').val(), callback); function callback(data) { if (data == "False") { alert('ID doesn\'t exist try again..!') return false; } else { $('#tblPassWord').show(); $('#tblprofile').hide(); role = data; } } } </code></pre> <p>But how working with A dataset.</p>
javascript jquery asp.net
[3, 5, 9]
5,103,253
5,103,254
Download an Excel from a URL and open it for reading?
<p>hi i need to read excel file which is stored in s3 server,i tried but it is showing invalid internet address.please help me to solve</p> <pre><code>string fullPath = "http://tempfordevelopment.s3.amazonaws.com/ad53498f-74e8-412c-8c8f-e36b18f16e4eEmailExcel2.xlsx"; //Uri uri = new Uri(fullPath); //string excelLocation = uri.LocalPath; String sConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + fullPath + "; Extended Properties='Excel 8.0;HDR=Yes'"; System.Data.DataSet DtSet; System.Data.OleDb.OleDbDataAdapter MyCommand; OleDbConnection objConn = new OleDbConnection(sConnectionString); MyCommand = new System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", sConnectionString); MyCommand.TableMappings.Add("Table", "Net-informations.com"); DtSet = new System.Data.DataSet(); MyCommand.Fill(DtSet);/////Here i am getting error as invalid internet address DataTable table = DtSet.Tables[0]; string[] strings = new string[table.Rows.Count]; int idx = 0; foreach (DataRow row in table.Rows) { StringBuilder sb = new StringBuilder(); object[] cells = row.ItemArray; for (int i = 0; i &lt; cells.Length; i++) { if (i != 0) sb.Append(','); sb.Append(cells[i]); } strings[idx++] = sb.ToString(); } </code></pre>
c# asp.net
[0, 9]
4,892,065
4,892,066
C#/ASP.NET/JS - onclick event shows row, postback hides row
<pre><code>rbnResubmission.Items.FindByValue("Yes").Attributes.Add("onclick", "getCheckedRadioFieldResubmission(this)"); rbnResubmission.Items.FindByValue("No").Attributes.Add("onclick", "getCheckedRadioFieldResubmission(this)"); </code></pre> <p>So I have these click events for showing rows in a table - that part works fine.</p> <p>Here's an example of what the code does (I'm not showing the "No" option)</p> <pre><code>function getCheckedRadioFieldResubmission(radio){ if(radio.value == "Yes"){ document.getElementById('&lt;%=ApprovingInstituteRow.ClientID%&gt;').style.display ="block"; document.getElementById('&lt;%=ApprovalNumberRow.ClientID%&gt;').style.display ="block"; document.getElementById('&lt;%=IRBApprovalRow.ClientID%&gt;').style.display ="block"; document.getElementById('&lt;%=ExpectedDateRow.ClientID%&gt;').style.display ="none"; } } </code></pre> <p>The form needs to go through validation, and if there's any problems, because the event to show these rows only happens from "onclick" - they will disappear upon postback. what can I change to make them appear permanently?</p>
c# asp.net javascript
[0, 9, 3]
2,973,324
2,973,325
Insert custom Button inside Gridview pager
<p>I am trying to insert a control inside Gridview pager. The Control appears successfuly but it assign it under the previous control as you can see in the picture. </p> <p><img src="http://i.stack.imgur.com/1YpzA.png" alt="enter image description here"></p> <p>I am adding with the following code. </p> <pre><code>if (e.Row.RowType == DataControlRowType.Pager) { e.Row.Cells[0].Controls.Add(ImageButton1); } </code></pre> <p>What i want is to assign the Save Answers button next to Previous button and not below. Any help pls ?</p>
c# asp.net
[0, 9]
5,611,835
5,611,836
simple jquery event handler
<p>having some real problems with jquery at the moment. Basically what I have so far is. The form is submitted once the form is submitted a grey box pop's up with the relevant infomation.</p> <p>What I need to do though is refresh the whole page then allow the grey box to appear.</p> <p>I have the following code</p> <pre><code> $("#ex1Act").submit(function() { //$('#example1').load('index.php', function() $("#example1").gbxShow(); return true; }); </code></pre> <p>the line which is commented out load's the page again after the form is submitted the other code makes the grey box pop-up.</p> <p>Is their a way to say once the:</p> <pre><code>$('#example1').load('index.php', function() </code></pre> <p>has been exucted do this:</p> <pre><code> $("#example1").gbxShow(); </code></pre> <p>hope this makes sense.</p>
javascript jquery
[3, 5]
5,344,065
5,344,066
project.properties in android project
<p>I just cloned this from <a href="https://github.com/jgilfelt/android-mapviewballoons">github</a> and when I tried to import it to eclipse as an android project, it doesn't have a default.properties. Why is this and how do I handle this?</p>
java android
[1, 4]
572,183
572,184
Execute jQuery after other scripts?
<p>I'm trying to use jQuery to change some styling on my page. The page is made dynamically by executing another JavaScript file.</p> <p>Right now I have </p> <pre><code>$(window).load(function(){ $('p').css('font','green'); }); </code></pre> <p>Which does nothing.</p> <p><code>$(document).ready(function()</code> will change the static part of the page, but not the generated part.</p> <p>If I just type <code>$('p').css('font','green');</code> in the console, the expected results will happen. What is going on?</p>
javascript jquery
[3, 5]
2,677,110
2,677,111
[android]Java script to Java native Bindings & vice versa
<p>I am a working on developing web applications where we are trying to access Native functionality in the phone using Java script APIs.</p> <p>Android Web view supports "AddJavascript" interface for Java script to Java (native) bindings as in below link</p> <p><a href="http://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object" rel="nofollow">http://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object</a>, java.lang.String)</p> <p>BUT if I need to pass data back to Java script there is no API or mechanism to do so in Android. Could any please let me know if there is a way out, tried hard using JSON as below by we cannot pass all kinds of values using JSON</p> <p>HTML with JS</p> <pre><code>&lt;script id="source" language="javascript" type="text/javascript"&gt; function OnClick(){ var nativeStr = window.native.getValue(); window.native.callBack(); } function JScallback(data) { } &lt;/script&gt; WebView wv = (WebView) findViewById(R.id.MyWebView); NativeClass myNative = new NativeClass (wv); wv.getSettings().setJavaScriptEnabled(true); wv.addJavascriptInterface(myNative, "native"); wv.loadUrl("file:///html/test.html"); public class NativeClass{ private WebView mWebView; public NativeClass (WebView appView) { this.mWebView = appView; } public String getValue() { return "Native Value"; } public void callBack() { JSONArray arr = new JSONArray(); JSONObject result = new JSONObject(); try { result.put("Name", "Android Dev"); arr.put(result); } catch (Exception ex) { } mWebView.loadUrl("javascript:JScallback(" + arr.toString() + ")"); } </code></pre> <p>Thanks in advance, Android Dev.</p>
javascript android
[3, 4]
899,665
899,666
Hide body until loaded, jQuery fadeout instead of javascript hide
<p>I'm using this code to hide a client's page until it's loaded:</p> <pre><code>&lt;style type="text/css"&gt; #cover {position: fixed; height: 100%; width: 100%; top:0; left: 0; background: #1984B5; z-index:9999;} &lt;/style&gt; &lt;script type="text/javascript"&gt; window.onload = hide; function hide(){ nav1=document.getElementById('cover').style nav1.display='none'; } &lt;/script&gt; </code></pre> <p>But the transition is a little jarring with javascript hide. I'd like to use the jQuery fadeout, but it looks like they've redefined the jQuery <code>$</code> as <code>jQuery</code>, and I'm not sure how to rewrite this so it works. I tried replacing <code>$</code> with <code>jQuery</code>, but that didn't work:</p> <pre><code>$("#cover").fadeOut(5000); </code></pre>
javascript jquery
[3, 5]
1,423,276
1,423,277
Reload a .js file without pressing F5
<p>i load a page with jquery <code>.load(file.php)</code> </p> <p>i have a .js include in the file.php like: <code>&lt;script src='js/script.js' type="text/javascript" language="javascript"&gt;&lt;/script&gt;</code></p> <p>When i load the file.php, he wouldn't load my JS file... does anybody know why and how to solve it?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,904,664
1,904,665
jquery .attr() not working in IE7. Any work around to get the class of the element?
<p>I am having this code to check if the element has the certain class: </p> <pre><code>var p3div = $("#portlet1 #showhide"); if (p3div.attr('class').indexOf('ui-icon-plusthick') &gt; 0) { //do something here. } </code></pre> <p>However in IE7 .attr() is not supported and this code will throw an error. Is there any other way to get the class of an element by not using the attr() method?</p> <p>Thanks,</p>
javascript jquery
[3, 5]
1,903,740
1,903,741
Disable browser buttons and url address bar in all major browsers?
<p>I don't know if this is possible but is it possible to disable a url address bar in the browser when a user is on a certain page? Also is the user able to disable browser buttons if a user is on a certain page?</p> <p>But the twist is that it needs to work on all browsers, Chrome, Safari, IE, Opera and Firefox. It has to work on all of these browsers. Can't fail in one of these browsers which I know makes this difficult.</p>
php javascript
[2, 3]
2,766,150
2,766,151
How to programmatically set the ForeColor of a label to its default?
<p>I'm using VS2010 C# ASP.NET</p> <p>To programmatically change the ForeColor of an asp:Label named <code>lblExample</code> to 'Red', I write this:</p> <pre><code>lblExample.ForeColor = System.Drawing.Color.Red; </code></pre> <p>After changing the ForeColor, how do I programmatically set the ForeColor of the label to its default (that comes from the css file)?</p> <p>Remark: the label has no CSS entry (class or ID specific style). The color is inherited.</p>
c# asp.net
[0, 9]
1,902,878
1,902,879
Jquery loop - capture the value
<p>I am running this loop in php but using a jquery click function during the output. How can i record which instance of $i was clicked. When I use $(this) it returns the id. </p> <p>The $('#pid-form').val('$frame_id[$i]') actually has the number i want as the value but I am not sure how to use it or convert it to a variable that I can use.</p> <pre><code>for($i = 0; $i &lt; $numRecords2; $i++){ $prod_id = $_SESSION['prod_array'][$frame_id[$i]]; echo" $('#frame$frame_id[$i]').click(function() { $('#top-left-frame').html('&lt;img src=\"$upper_left[$i]\" alt=\"\" /&gt;'); $('#top-mid-frame').css('background-image','url($upper_middle[$i])'); $('#top-right-frame').html('&lt;img src=\"$upper_right[$i]\" alt=\"\" /&gt;'); $('#mid-left-frame').css('background-image','url($middle_left[$i])'); $('#mid-right-frame').css('background-image','url($middle_right[$i])'); $('#bottom-left-frame').html('&lt;img src=\"$bottom_left[$i]\" alt=\"\" /&gt;'); $('#bottom-mid-frame').css('background-image','url($bottom_middle[$i])'); $('#bottom-right-frame').html('&lt;img src=\"$bottom_right[$i]\" alt=\"\" /&gt;'); $('#frame-select').html('$prod_id'); $('#pid-form').val('$frame_id[$i]'); $('#oa_id-form').val('$prod_id'); var frameState = $(this).attr('id'); $.cookie('frameState', frameState, { expires: 7 }); alert($.cookie('frameState') + ' was clicked.'); }); "; } </code></pre>
php jquery
[2, 5]
1,495,229
1,495,230
Loading DLC files in Python or C++ or Java
<p>Is there any Libraries that allow for loading of DLC files in Python Java or C++? FYI <a href="http://jdownloader.org/knowledge/wiki/linkprotection/container/dlc-rsdf-and-ccf" rel="nofollow">link</a></p>
java c++ python
[1, 6, 7]
1,247,695
1,247,696
Print both in Android and pure Java
<p>How to print both to Log.e/d/etc. and to System.out/err/etc.? I have some code that I test on desktop and sometimes I use it on Android and I want to see logs there too.</p>
java android
[1, 4]
4,569,971
4,569,972
on .bind('click') it is not deleting the first div
<p>When I click on a particular div, that div should fade out, simple, but when I click on one of the divs it deletes the div on top of the stack, i.e. when I click #sel6 it removes sel5</p> <p><strong>HTML code</strong></p> <pre><code>&lt;div id="selc_d" class="selc" style="position:absolute; left:15px; top:200px; width:260px;"&gt; &lt;div id="sel5" class="sel"&gt;something&lt;/div&gt; &lt;div id="sel6" class="sel"&gt;something&lt;/div&gt; &lt;div id="sel7" class="sel"&gt;something&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>jQuery code</strong> sel_id, sel_1 are variables</p> <pre><code>$('.selc_d').bind('click',function(){ var sel_id = $('.sel').attr('id'); alert(sel_id); $('#'+sel_id).fadeOut('slow'); $('#'+sel_id).remove(); $('.search_box').append(sel_1); }); </code></pre>
javascript jquery
[3, 5]
2,928,571
2,928,572
new XmlSerializer(typeof(MyClass)) Causing Memory corruption?
<p>I've got an application that loads an assembly dynamically:</p> <pre><code> Assembly asm = Assembly.Load("MyClass.DLL"); Type type = asm.GetType("MyClass"); MyClass runningAssembly = (MyClass)Activator.CreateInstance(type); runningAssembly.start(); </code></pre> <p>Once loaded and the start() method is called, this line of code is executed:</p> <pre><code> XmlSerializer deserializer = new XmlSerializer(typeof(MyClass)); </code></pre> <p>And the following exception is thrown:</p> <pre><code> "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." </code></pre> <p>I've been stumbling on the cause of this and haven't been able to get a grasp on it. Does anyone have any tips? I also cannot seem to trap this error... it blows right through the try/catch.</p> <p>By the way, the error doesn't <em>always</em> happen. Sometimes in debug mode it works fine, but it seems like once it starts, it'll always happen even after restarting Visual Studio. A reboot clears it up and allows it to work at least once. It also happens when running from the compiled EXE.</p> <p><strong>EDIT</strong></p> <p>I tried the same thing but without loading the assembly dynamically. I called it as a class directly, i.e:</p> <pre><code>MyClass c = new MyClass(); c.start(); </code></pre> <p>And the same problem persists, so it does NOT appear to be related to being loaded dynamically.</p>
c# asp.net
[0, 9]
4,337,280
4,337,281
Prevent scrollTop from calling scroll event
<p>I'm trying to create this behavior: when user scrolls a mousewheel (or presses <kbd>↓</kbd>) the webpage is scrolled down by the height of the window.</p> <p>I've ended up with following code:</p> <pre><code>var newScrollTop, oldScrollTop = $(window).scrollTop(), preventScroll = false; $(window).scroll(function() { if (!preventScroll) { preventScroll = true; newScrollTop = $(this).scrollTop(); if (newScrollTop &gt; oldScrollTop) { $(this).scrollTop( oldScrollTop + $(window).height() ); } else { $(this).scrollTop( oldScrollTop - $(window).height() ); } oldScrollTop = newScrollTop; preventScroll = false; } }); </code></pre> <p>But this doesn't work as I expect it: on scroll event page is scrolled to the very edge (bottom or top). What am I missing?</p>
javascript jquery
[3, 5]
3,903,281
3,903,282
Calling global variables in the AppSettings from a Javascript function
<p>In my javascript function I am trying to call my global variable that is currently defined in the webconfig file of my Asp.net project. What is the syntax for this? I've looked around and nothing seems to work so far. I've tried the following but I am not getting anything from it:</p> <p>web.config:</p> <pre><code>&lt;appSettings&gt; &lt;add key="var1" value="123456"/&gt; &lt;/appSettings&gt; </code></pre> <p>default.aspx:</p> <pre><code>&lt;script type="text/javascript"&gt; function doSomething() {"&lt;%= System.Configuration.ConfigurationManager.AppSettings['var1'].ToString(); %&gt;" }; &lt;/script&gt; </code></pre>
c# asp.net javascript
[0, 9, 3]
2,211,164
2,211,165
Place random positioned element into a document in vertical axes
<p>I have the following code</p> <pre><code>function randomizer(start, end) { return Math.floor((end - start) * Math.random()) + 1; } var top_pos = randomizer(1, $(document).height()); $('.element_selector').css('top', top_pos + 'px'); </code></pre> <p>but the result is not what I realy expect from. The most of the times the element is places near to top (about 80% of the times).</p> <p>Is there any better solution to place my random element in realy random position into vertical axes ?</p>
javascript jquery
[3, 5]
4,895,477
4,895,478
ScrollView containing TextView does not scroll
<p>I have a textview displaying many individual words, each word is a link using Spans and setMovementMethod(LinkMovementMethod.getInstance()); The textview is wrapped by a ScrollView. </p> <p>However the ScrollView does not work as the links in the TextView are activated instead.</p> <p>Is there a way to combine a ScrollView and TextView so that both the scrolling and links in the text work?</p>
java android
[1, 4]
2,227,467
2,227,468
Passing form values on a submit to an ajax call
<p>I have a common case of allowing a user to submit a form with some values and needed to pass those values to my ajax call. This approach works, but is there a more elegant/efficient way of accessing the form values other than using selectors?</p> <pre><code>$("#myForm").submit(function(){ myData = {name: $("#name").val(), age: $("#age").val()} $.ajax({ url: "foo.php", data: myData, type: get }); }); &lt;form id="myForm"&gt; Name: &lt;input type="text" id="name"&gt; Age: &lt;input type="text" id="age"&gt; &lt;/form&gt; </code></pre>
javascript jquery
[3, 5]
4,039,993
4,039,994
TextBox filtering according to RadioButton selection
<p>I've a <code>RadioButtonList</code> and a <code>TextBox</code>. Accordindg to RadioButtonList selection, I want to filtrering textbox.</p> <pre><code> &lt;asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"&gt; &lt;asp:ListItem Text="NUMBER" Value="1" Selected="True"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="TEXT" Value="2"&gt;&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; &lt;asp:TextBox ID="txtID" runat="server"&gt; </code></pre> <p>When I click listitem with value <code>1</code>, user can enter number to textbox. value <code>2</code>, number + text. also I want to set the length. Can someone show me how to do this?</p>
c# javascript asp.net
[0, 3, 9]
4,869,886
4,869,887
Adding days to a date - date getting converted to string
<p>So I'm trying to add a certain number of days to a date, and I'm getting a strange issue:</p> <pre><code>var date = new Date(); var newdate = date.getDate() + $('#ddlDays option:selected').val(); date.setDate(newdate); </code></pre> <p>So if today is 09/29/2010, the Date is 29. But if a user selects "5" from ddlDays, it will assume I am adding strings together, adding 295 days to my date.</p> <p>I was under the impression that javascript would assume they were integers? Does getDate() return a string instead of an integer?</p> <p>How can I fix this?</p>
javascript jquery
[3, 5]
2,604,725
2,604,726
Apostrophes in jquery/javascript string
<p>I have the following code which appends an icon with an alert after the <code>&lt;a&gt;</code> tag :</p> <pre><code>$j("li[name='"+node_name+"'] &gt; a").after('&lt;a onmouseover="alert(\' expnote_from_db[n][0] \');" &gt;&lt;ins class="' + selected_class + '"&gt;&amp;nbsp;&lt;/ins&gt;&lt;/a&gt;'); </code></pre> <p>The code above works fine except that it displays <code>exp_from_db[n][0]</code> as a string inside the alert box.</p> <p>So I changed it to the code below but nothing is displayed now</p> <pre><code> $j("li[name='"+node_name+"'] &gt; a").after('&lt;a onmouseover="alert(\'"'+ expnote_from_db[n][0] + '"\');" &gt;&lt;ins class="' + selected_class + '"&gt;&amp;nbsp;&lt;/ins&gt;&lt;/a&gt;'); </code></pre> <p>I don't understand where did I go wrong with the apostrophes.</p> <p>I would appreciate your help regarding this. Thanks</p>
javascript jquery
[3, 5]
5,397,877
5,397,878
Android Button Doesn't Respond After Animation
<p>I have a basic animation of a button after it is pressed currently in my application. After the button finishes animating, I can no longer click on it. It doesn't even press with an orange highlight.</p> <p>Any help?</p> <p>Here's my code:</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); animation = new AnimationSet(true); animation.setFillAfter(true); Animation translate = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 5.0f); translate.setDuration(500); animation.addAnimation(translate); LayoutAnimationController controller = new LayoutAnimationController(animation, 0.25f); generate = (Button)findViewById(R.id.Button01); generate.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ keyFromTop(); } }); } public void keyFromTop(){ generate.setAnimation(animation); } </code></pre>
java android
[1, 4]
5,510,354
5,510,355
Android Load images from drawable
<p>In my android project I have several images int the drawable folder with a prefix that I would like to load in a HashMap : </p> <p>Example :</p> <pre><code>PREFIX_G6.png PREFIX_P7.png PREFIX_P9.png </code></pre> <p>I can construct the bitmap for a specific Image Like this :</p> <pre><code>String drawableName = "PREFIX_" + "G6"; // ignore the extension int drawableId = context.getResources().getIdentifier(drawableName, "drawable", PACKAGE_NAME); Bitmap icon = BitmapFactory.decodeResource(context.getResources(), drawableId); mIcons.put(drawableName, icon); // my Hashmap </code></pre> <p>In order to load all the images from the drawable folder I need to be able to list them and test if they start with my PREFIX_ any ideas ?</p>
java android
[1, 4]
1,156,846
1,156,847
Append text to label in ASP.NET/C#?
<p>Lets say I have a form where the user enters some data and then click Submit. I have some validation to check length of fields in the code behind and if they forgot the name I set the text in a label:</p> <pre><code> if (siteName.Length == 0) { lblErrorCreateSite.Text = "A Site Name is required.&lt;br/&gt;"; } </code></pre> <p>If I also have a field called description and this is also empty can I append an error message to lblErrorCreateSite or do I have to create another label?</p> <pre><code> if (siteDescription.Length == 0) { lblErrorCreateSite. // if both name and description is missing add some additional text to the label } </code></pre> <p>I'm just checking to see if there's an easier way than to have a lot of if statements (if this AND that...)</p> <p>Thanks in advance.</p> <p>Edit: I just realized I can do</p> <pre><code> if (siteName.Length == 0) { lblErrorCreateSite.Text = "A Site Name is required.&lt;br/&gt;"; } if (siteDescription.Length == 0) { lblErrorCreateSite.Text = lblErrorCreateSite.Text + "A description is required."; } </code></pre> <p>?</p>
c# asp.net
[0, 9]
2,991,098
2,991,099
Adding z-index to a window
<p>How can I add a zindex value to the following string so that the pop-window is always on top?</p> <pre><code>string winopen = "Window.Open('Details - " + name + "', 'test.aspx', 'dest=" + destination.Value + "&amp;id=" + id.Value + "', [250,250], [100,100], true); return false;"; button1["onclick"] = winopen ; </code></pre>
c# javascript jquery
[0, 3, 5]
4,753,845
4,753,846
Run C# code after running all javascript codes
<p>I am having a form in which a button is there on click of that button i am calling a javascript function in which i am displaying like 3.. 2.. 1 kind of effect then i am returning true.</p> <p>But after showing 3 only return true is getting executed and the form is getting submitted.</p> <p>How to stop form submitting before running the script.</p> <p>Edit:</p> <pre><code>function jsFun() { timerCount(3); //Calling the Timer Function. } var t; function timerCount(cDown) { if (cDown == 0) { clearTimeout(t); return true; } $('#&lt;%= mainContainer.ClientID %&gt;').html(cDown); cDown = cDown - 1; t = setTimeout('timerCount(' + cDown + ')', 1000); } &lt;asp:Button ID="btnStarts" runat="server" Text="Start" OnClientClick="return jsFun();" OnClick="btn_click" /&gt; </code></pre>
asp.net javascript
[9, 3]
4,270,545
4,270,546
asp.net authentication and authorisation
<p>I am using Form authentication. Here I am using a login control and in (login.cs) control I am calling the following method to validate the user. Here I am using local name for both username and password and now I want to connect to the database so I can retrieve username and password.</p> <pre><code>private bool Authenticateme(string username, string password, bool remberusername) { String localusername = "username"; String localpassword = "amar"; if (username.Equals(localusername) &amp;&amp; password.Equals(localpassword)) { return true; } else { return false; } } </code></pre>
c# asp.net
[0, 9]
1,395,833
1,395,834
Can we integrate napster in a .net website?
<p>Can we integrate napster in a .net website? If so please suggest any documentation to refer to. Thanks.</p>
c# asp.net
[0, 9]
3,908,454
3,908,455
using javascript to disable link in php script
<p>Hello I am trying to disable a link in my PHP script using a JS function. I am not sure why is its not working. Any input appreciated.. </p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function disable() { document.getElementById("perfumes_web_link").innerHTML='&lt;a href="javascript: void(0)"&gt;&lt;http://www.google.com" rel="external""&gt;Perfumes&lt;/a&gt;'; } function enable() { document.getElementById("perfumes_web_link").innerHTML='&lt;a href="http://www.google.com" rel="external""&gt;Perfumes&lt;\/a&gt;'; } &lt;/script&gt; &lt;/head&gt; &lt;?php $disable_link = 0 ; echo '&lt;h1&gt;JavaScript to disable link if set to zero&lt;/h1&gt;'; echo '&lt;li&gt;&lt;span id="perfumes_web_link"&gt;&lt;/span&gt;&lt;br&gt;'."\n"; echo '&lt;span class="perfumes_browser"&gt;&lt;small&gt;(Internet Explorer v6 or higher req.) &lt; /small&gt;&lt;/span&gt;&lt;/li&gt;'; if ($disable_link = 1) {echo '&lt;script type="text/javascript"&gt;disable();&lt;/script&gt;'; } elseif ($disable_link = 0) { echo '&lt;script type="text/javascript"&gt;enable();&lt;/script&gt;'; } ?&gt; &lt;/html&gt; </code></pre> <p>So what am i doing wrong? Should i use if/else statement in the JS function itself or should i use true/false instead of 0 and 1.</p> <p>Should i use something else like jQuery or Ajax..</p> <p>Thanks </p>
php javascript
[2, 3]
120,089
120,090
jQuery scrolling text on hover
<p>I have a "a" element that I want to scroll left on hover. To do this I remove the first character and append it to the end of the string.</p> <p>How can I continuously fire up the scroll function?</p> <p>Mouse enters element -> scroll() is fired until mouse leaves the element or user clicks on it.</p> <p>html:</p> <pre><code>&lt;a href="foo.htm" class="scrollthis"&gt;this text scrolls on hover&lt;/a&gt; </code></pre> <p>jQuery:</p> <pre><code>$(".scrollthis").hover(function(){ scroll($(this)); }); function scroll(ele){ var s = $(ele).text().substr(1)+$(ele).text().substr(0,1); $(ele).text(s); } </code></pre>
javascript jquery
[3, 5]
1,763,786
1,763,787
Prompt user to save/open file in ASP.NET C#
<p>It shouldn't be this hard to find out how to do this. Basically I'm trying to take a string and let the client save it when they click a button. It should pop up with a Save/Open dialog. No extra bells and whistles or anything. It's not rocket science, (or so I would've thought).</p> <p>There seems to be a ton of different ways, (StreamWriter, HttpResponse, etc.), but none of the examples I've been able to find work properly or explain what's going on. Thanks in advance.</p> <p>An example one of the many blocks of code I've found...</p> <p>(This is just an example, feel free to not base your answer around this.)</p> <pre><code>String FileName = "FileName.txt"; String FilePath = "C:/...."; //Replace this System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.ClearContent(); response.Clear(); response.ContentType = "text/plain"; response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";"); response.TransmitFile(FilePath); response.Flush(); response.End(); </code></pre> <p>Line 2 says to replace that string. How? This code was advertised as bringing up a dialog. I shouldn't be having to set a path in the code, right?</p> <p>EDIT: Final Outcome (Edited again, Delete has to come before End();)</p> <pre><code> string FilePath = Server.MapPath("~/Temp/"); string FileName = "test.txt"; // Creates the file on server File.WriteAllText(FilePath + FileName, "hello"); // Prompts user to save file System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.ClearContent(); response.Clear(); response.ContentType = "text/plain"; response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";"); response.TransmitFile(FilePath + FileName); response.Flush(); // Deletes the file on server File.Delete(FilePath + FileName); response.End(); </code></pre>
c# asp.net
[0, 9]
929,403
929,404
How to link Android application and web-service?
<p>I made an Android application and I have a web-service (written in PHP). The service must send a message to application, so while my Android application works in the background and monitors web-service, it gets the message from service.</p> <p>How can I organize this interaction? Thank you</p>
java php android
[1, 2, 4]
5,660,575
5,660,576
How to change execution context in jQuery without invoking the function
<p>I'm a lover of MooTools, and get used to bind the callback functions, for example:</p> <pre><code>element.addEvent('click', callback.bind(this)); </code></pre> <p>Assume <em>this</em> is the current execution context. This statement means that, I'm binding the execution context of <em>this</em> to the function <em>callback</em>. Also, as far as I know, certain browsers (e.g., Chrome) have added bind() into their JavaScript engines.</p> <p>Now my job needs me to switch to using jQuery. Clearly, the bind() has a different meaning in jQuery, which is close to addEvent() in MooTools. I could not figure out a way to change the execution context. I had to do the following:</p> <pre><code>var that = this; element.click(function () { callback.apply(that); // Have to invoke it, and also with extra function wrapper }); </code></pre> <p>But I wanted to do something like:</p> <pre><code>element.click(callback.*bind*(this)); </code></pre> <p>Any jQuery guru has ideas?</p>
javascript jquery
[3, 5]
1,252,584
1,252,585
Uncaught Could not find Overlay: #prompt
<p>I'm trying to call the jquery overlay function from a javascript function and failing.</p> <p>I get the error: Uncaught Could not find Overlay: #prompt </p> <pre><code>this.mySaturdayNight = function() { var bark_overlay = document.createElement("div"); bark_overlay.innerHTML="hey guy"; bark_overlay.setAttribute('class', 'modal'); bark_overlay.setAttribute('id', 'prompt'); var sajT = new oblTable(1,3); var btn = document.createElement("button"); btn.innerHTML = "test"; btn.setAttribute("rel", "#prompt"); btn.setAttribute("class", "modalInput"); sajT.addContent(0,2,btn); var triggers = $(".modalInput[rel=#prompt]").overlay({ // some mask tweaks suitable for modal dialogs mask: { color: '#ebecff', loadSpeed: 200, opacity: 0.9 }, closeOnClick: false }); } </code></pre> <p>Any ideas? Stackoverflow is the best!</p> <p>Thanks!</p>
javascript jquery
[3, 5]
4,650,598
4,650,599
check for existing values in Datatable
<pre><code> if (dt.Rows[i]["Code"] == code) { Label lblLang = (Label)(((e.Item as GridItem).FindControl("lblLang") as Label)); lblLang.Visible = true; } else { } } </code></pre> <p>I am adding a new language Fr-FR in the code above. fr-FR already exists in my DB's Language Table. I do not want to add duplicate values in my table. There should be only one fr-FR. What am I doing wrong in the code above?</p>
c# asp.net
[0, 9]
206,902
206,903
returning a variable from the callback of a function
<p>I am using the following functions:</p> <pre><code>function loop_perms(permissions) { .... call check_perm here.... } function check_perm(perm) { var result; FB.api( { method: 'users.hasAppPermission', ext_perm: perm }, function(response) { result = response; }); return result; } </code></pre> <p>Now, the issue is that I am getting an <code>undefined</code> from the result of <code>check_perm</code> whereas in the Firebug console, I can see that <code>response</code> has a value of 0 or 1 (depending on perm)</p> <p>Anyone knows what I am doing wrong? I am guessing it has something to do with the fact that i am trying to capture the value of a variable inside a callback.</p> <p>Regards Nikhil Gupta.</p>
javascript jquery
[3, 5]
1,115,490
1,115,491
Weird Behaviour in jQuery's html method
<p>Any good reason why $("p").html(0) makes all paragraphs empty as opposed to contain the character '0'?</p> <p>Instead of assuming I found a bug in jQuery, it's probably a misunderstanding on my part.</p>
javascript jquery
[3, 5]
3,229,116
3,229,117
Stop user to Shift+F5 on the Page
<p>Does any one here know how can I stop user to Shift+F5 or F5 (refresh the page) on the Page by Jacascript or jQuery?</p> <p>The reason is just to stop the page resubmit the same variable into the server side after the user clicked on the 'submit' button then pressed F5 again</p>
javascript jquery
[3, 5]
4,350,697
4,350,698
How to get pagemthods value in the calling function
<p>I want to fetch current year from the server using PageMethods but PageMethods returns result in different function but i want to get the return value in the same function where PageMthods is called. Is it possible?</p> <pre><code>function GetYear() { dr["OrderYear"] = PageMethods.GetCurrentYear(Onsuccess); } function Onsuccess(currYear) { alert(currYear); } [WebMethod] public static string GetCurrentYear() { return DateTime.Now.Year.ToConvertedString(); } </code></pre> <p>I want currYear to be assigned to dr["OrderYear"] which is actually a calling function</p>
javascript asp.net
[3, 9]
2,780,772
2,780,773
Question about select all H3 inside DIV
<p>Wouldn't this work if I want to apply a new class to all H3 tags inside the RelArtik div?</p> <pre><code>$("h3",$("#RelArtik")).addClass("underrubrik"); </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
2,991,274
2,991,275
How can i create multitasking between activities?
<p>I want to display two activities at a time and can work on both simultaneously. Is it possible ? if possible please give me some example. I am working in android 2.2 froyo.</p> <p>Thanks in advance</p>
java android
[1, 4]
1,518,950
1,518,951
Show a div if check box is checked and vice-versa
<p>I'm trying to find the value of a check box and then if it is checked it should show my div id as resizeable. If its not checked it should disappear. This is what I tried:</p> <pre><code>var showheader = document.getElementById("ckbx_header").checked; if ( showheader == checked ) { $("#resizeable").toggle("slide", {}, 1000) ); }; </code></pre>
javascript jquery
[3, 5]
510,476
510,477
calling functions of the application via javascript from embeded browser?
<p>I have an embeded browser in C# application which I am displaying static webpages in. Can I call a function of the app by pressing a button in a webpage inside of the embeded browser via javascript?</p>
c# javascript
[0, 3]
2,807,606
2,807,607
functionality required only to show certificate(image) for registered members
<p>I want to junrate a certificate(image) general code from my site registers members certificate will only show on his sites.for exmple abc.com is my registerd member and he placed that code on his site like bellow</p> <pre><code>img src="mysite.com?member=abc.com" </code></pre> <p>or any code (like facebook social plugin or like plugin of facebook etc) when its calling from abc.com the code will display the certificate(image) but when same code applies to another location like www.def.com the certificate(image) should not to display.</p>
php javascript jquery
[2, 3, 5]
2,877,369
2,877,370
How to load .ascx control in .aspx page with out postback or reloading the page
<p>I have some code that is running fine , what i want is when i create a cookie i want the .ascx control to load to perform some function on the cookie but i don't want the page to post back, how can i achieve that.</p>
javascript asp.net
[3, 9]
2,792,042
2,792,043
Pictures saved on sdcard on android
<p>I had a problem when saving picture on sdcard from my app. that when i am taking a picture and saving it on sdcard and go to my app and take a new one and save it on sdcard the previous preview picture appear and when view it on my computer it appear corrupted ?</p> <p>why this problem ?</p> <pre><code>public static void save(Bitmap bm, String path) { OutputStream outStream = null; try { outStream = new FileOutputStream(new File(path)); bm.compress(Bitmap.CompressFormat.JPEG, 100, outStream); outStream.flush(); outStream.close(); bm.recycle(); System.gc(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } enter code here </code></pre>
java android
[1, 4]
653,005
653,006
Popup window after submit
<p>Just to ask a straight question, when I complete adding some data in my page and click submit button, how can I make a popup window saying that the information has been successfully added in database instead of make a new page? Is there any ways that I can do? Any website to be referred? Thanks</p>
c# asp.net
[0, 9]
909,689
909,690
How to get value set in javascript from code-behind?
<p>I set value in a hidden field like this:</p> <pre><code>((TextBox)ctrl).Attributes.Add("onchange", "document.getElementById('" + ((BasePage)Page).GetControl(Page, "ChangedRowsIndicesHiddenField").ClientID + "').value.concat('" + row.RowIndex + ",');"); </code></pre> <p>In page source it looks like this:</p> <pre><code>onchange="document.getElementById('ctl00_CPHDefault_tcTPS_TPProd_ctl01_tcProduction_TPNewTitlesStatus_ChangedRowsIndicesHiddenField').value.concat('0,');" </code></pre> <p>I want to be able to retrieve and use this value from code-behind on postback (button click):</p> <pre><code>string ChangedRowsIndices = ChangedRowsIndicesHiddenField.Value.TrimEnd(','); </code></pre> <p>But because of some reason, ChangedRowsIndices is always empty. Could you please help me with this? What am I doing wrong? Here is the hidden field:</p> <pre><code>&lt;input id="ChangedRowsIndicesHiddenField" type="hidden" runat="server" /&gt; </code></pre> <p>Thanks.</p>
c# javascript asp.net
[0, 3, 9]
597,201
597,202
This script applies specific attr to all links on the website. How to exclude pdf and zip files?
<p>I'm building Wordpress website where all pages are being loaded using Ajax. I'm using script created by Chris Coyer that can be found <a href="http://css-tricks.com/video-screencasts/81-ajaxing-a-wordpress-theme/" rel="nofollow">here</a>. Code below will add specific tags to all links on the website. Wordpress will try to load content from those links using Ajax. Problem is that those attributes are being applied on links to PDF and ZIP files which are meant to be downloaded, not loaded into page. </p> <p>How I can exclude specific file formats from getting those attributes? I already tried something like this <code>$internalLinks = $("a[href^='"+siteURL+"']:not([href$=/*.pdf])")</code> but that didn't work for me. Am I doing something wrong?</p> <p>Below is part of the original code that adds attributes. Full code can be found on this <a href="http://jsfiddle.net/Klikerko/ev6MM/1/" rel="nofollow">JSFiddle page</a>. Thanks!</p> <pre><code>var $mainContent = $("#main-content"), siteURL = "http://" + top.location.host.toString(), $el = $("a"); function hashizeLinks() { $("a[href^='" + siteURL + "']").each(function() { $el = $(this); // Hack for IE, which seemed to apply the hash tag to the link weird if ($.browser.msie) { $el.attr("href", "#/" + this.pathname).attr("rel", "internal"); } else { $el.attr("href", "#" + this.pathname).attr("rel", "internal"); } }); };​ </code></pre>
javascript jquery
[3, 5]
1,663,017
1,663,018
Can't listen to hover (etc) events after creating divs using innerHTML
<p>So I generate some divs using this</p> <pre><code>document.getElementById('container').innerHTML += '&lt;div class="colorBox" id="box'+i+'"&gt;&lt;/div&gt;'; </code></pre> <p>The problem I'm running into is that catching a hover event</p> <pre><code>$(".colorBox").hover(function(){ alert("!"); }); </code></pre> <p>Won't work after doing that. Any thoughts?</p> <p>EDIT: To be more clear, check this out: <a href="http://graysonearle.com/test/16_t.html" rel="nofollow">http://graysonearle.com/test/16_t.html</a></p> <p>I need to be able to have hover events happen after changing innerHTML that happen dynamically and many times. So like after changing the number of columns, the hover effect needs to work.</p> <p>THANKS TO CHOSEN ANSWER: For those in the future that might want to do something similar, my code looks like this now:</p> <pre><code>$(document).ready(function(){ document.body.onmousedown = function() { ++mouseDown; } document.body.onmouseup = function() { --mouseDown; } $(document).on("mouseenter",".colorBox",function(){ if(mouseDown){ var clicked = $(this).attr("id"); var clicked = clicked.substring('box'.length); next_color(clicked); } $(this).css("border-color","#ff0"); }).on("mouseleave", ".colorBox", function() { $(this).css("border-color","#aaa"); }); $(document).on("click",".colorBox",function(){ var clicked = $(this).attr("id"); var clicked = clicked.substring('box'.length); next_color(clicked); }); }); </code></pre>
javascript jquery
[3, 5]
5,352,596
5,352,597
Is there a light theme for Android?
<p>I'm trying to use a light theme on my app, but in a way so that I can customize it (hints why I'm creating my own theme). Despite using <code>AppTheme.NoActionBar</code> I still see a bar while my app is loading at the top.</p> <pre><code>&lt;style name="AppTheme" parent="@android:style/Theme.Holo.Light"&gt; &lt;/style&gt; &lt;style name="AppTheme.NoActionBar" parent="@android:style/Theme.Holo.Light.NoActionBar"&gt; &lt;/style&gt; </code></pre> <p>Any thoughts on why this is happening?</p> <p>I'm using the latest version of Android, using Nexus_S as my device.</p>
java android
[1, 4]
5,811,707
5,811,708
NullReferenceException in static class
<p>I have an asp.net application with a static "global" class. Inside of the static class I have a variable called user. When a user logs in a set that variable. Debugging through the log process. All my other static variable seems to be fine except two. I am not sure why I am getting 'GlobalVariables.User' threw an exception of type 'System.NullReferenceException'. Can anyone shed some light on this. Thanks</p> <pre><code>namespace GlobalClass public static class GlobalVariables public static User User { get; set; } </code></pre>
c# asp.net
[0, 9]
1,766,752
1,766,753
Writing a cookie from a static class
<p>I have a static class in my solution that is basically use a helper/ultility class.</p> <p>In it I have the following static method:</p> <pre><code>// Set the user public static void SetUser(string FirstName, string LastName) { User NewUser = new User { Name = String.Format("{0}{1}", FirstName, LastName) }; HttpCookie UserName = new HttpCookie("PressureName") { Value = NewUser.Name, Expires = DateTime.Now.AddMinutes(60) }; } </code></pre> <p>User is a simple class that contains:</p> <pre><code> String _name = string.Empty; public String Name { get { return _name; } set { _name = value; } } </code></pre> <p>Everything works up until the point where I try to write the cookie "PressureName" and insert the value in it from NewUser.Name. From stepping through the code it appears that the cookie is never being written.</p> <p>Am I making an obvious mistake? I'm still very amateur at c# and any help would be greatly appreciated.</p>
c# asp.net
[0, 9]
2,994,000
2,994,001
Add chars on line break
<p>Hi I have list (ul) and in it some "li".</p> <p>With Javascript (jQuery) how do I detect when line breaks and add some chars on beginning.</p> <p>So for example:</p> <pre><code>I have a very looooong text in 200px width li. </code></pre> <p>Result is:</p> <pre><code>I have a very looooong text in 200px width li. </code></pre> <p>And I want to add " + " on the beginning of new line => result:</p> <pre><code>I have a very looooong text + in 200px width li. </code></pre> <p>thx</p>
javascript jquery
[3, 5]
4,286,269
4,286,270
A sensible path to becoming a C# and ASP.NET guru?
<p>I suppose this question is pretty subjective, but I think there is bound to be a path that most people consider sensible.</p> <p>I've been working with C# and ASP.NET for about 3 years, but I've only just started REALLY studying it. My goal is to become a guru in say... 5-10 years. What skills should I have? What should I make sure I have a full understanding of? What types of applications should I make to test myself? Are there any other languages that I should learn to increase my understanding/ability in C#?</p> <p>Additionally, is there a particular order to learn the skills in? Say, hypothetically:</p> <ul> <li>Learn C# to an intermediate level</li> <li>Learn C++/C for a more base level understanding</li> <li>Learn CIL to understand what the compiler is doing to your C#</li> </ul> <p>Etc. etc.</p> <p>I appreciate any help you guys could give me. Any book/blog/website recommendations, anything really.</p>
c# asp.net
[0, 9]
2,655,078
2,655,079
attach the document object
<p>i need to attach the document object to move div inside another div, here is the script: <a href="http://jsfiddle.net/vhDpG/2/" rel="nofollow">http://jsfiddle.net/vhDpG/2/</a> i want to move the block "moveme" just inside the <code>#bee_div1</code> not inside the <code>#body</code> div, but the action - animate(), must be triggered everytime mousemoves inside the <code>#body</code></p> <p>thank you all for help!</p>
javascript jquery
[3, 5]
3,431,174
3,431,175
How to do repeated actions in Android?
<p><strong>I use such code:</strong> </p> <pre><code>t = new Timer(); t.schedule(new TimerTask() { @Override public void run() { //some action } }, 30000, 30000); </code></pre> <p>If I wrap up application(click Home) and after that recover application then task is canceled. How to solve that problem?</p>
java android
[1, 4]
821,564
821,565
destroy $_SESSION after cliking 'Cancel' button
<p>I would like to destroy $_SESSION['userList'] after cliking 'Cancel' button. However, the $_SESSION['userList'] is destroied when page load.</p> <p>Below is my code:</p> <pre><code>&lt;a href='#' class="btn" onClick="resetForm()"&gt;&lt;span&gt;Cancel&lt;/span&gt;&lt;/a&gt; &lt;script type="text/javascript"&gt; function resetForm() { &lt;?php unset($_SESSION['userList']); ?&gt; } &lt;/script&gt; </code></pre> <p>Really appreciate for any help.</p>
php javascript
[2, 3]
2,396,917
2,396,918
How to run a javascript function before postback of asp.net button?
<p>I'm using Javascript to create a DIV element and open up a new page by using onclientclick. This works great. Now, I need to write to it from the server side and this element must be created before it is posted back.</p> <p>How do I get the javascript to execute before the postback?</p> <p>Currently, I have to press the button twice because the element doesn't exist to write too on the first click.</p> <p>To be clear, I need this to execute before the "OnClick" of the button.</p> <p>Update: It looks like the Javascript function is called before the postback but the element is not updated until I run the second postback. Hmm</p> <p>Update: Unfortunately it is a bit more complicated then this.</p> <p>I'm creating a div tag in javascript to open a new window. Inside the div tag, I'm using a databinding syntax &lt;%=Preview%> so that I can get access to this element on the server side. From the server side, I'm injecting the code.</p> <p>I'm thinking this may be a chicken-egg problem but not sure.</p> <p>UPDATE!</p> <p>It is not the Javascript not running first. It is the databinding mechanism which is reading the blank variable before I'm able to set it.</p> <p>Hmm</p>
asp.net javascript
[9, 3]
5,678,855
5,678,856
Convert this PHP code to C# Rijndael Algorithm
<p>I've got this php code and I'd like to get the exact equivalent C#</p> <pre><code>$ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_192, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND); $encryptedData = mcrypt_encrypt(MCRYPT_RIJNDAEL_192, $key, $salt . $message . $nonce, MCRYPT_MODE_CBC, $iv); $base64Data = base64_encode($salt . $iv . $encryptedData); $urlEncodedData = rawurlencode($base64Data); </code></pre> <p>All contributions gratefully received!</p>
c# php
[0, 2]
2,699,252
2,699,253
Jquery: Iterate an array and find nodes with a specific id
<p>I have a list of div elements:</p> <pre><code>var list = $('.divelement').get(); </code></pre> <p>I want to use jQuery to find a specific element (that has an id that contains "hdnPK") in each of these div elements. Something like:</p> <pre><code>var elem1 = list[0].$("[id*='hdnPK']").get(); var elem2 = list[1].$("[id*='hdnPK']").get(); </code></pre> <p>But you cant write it like i do above. How do you iterate through a regular array with jQuery?</p>
javascript jquery
[3, 5]
1,705,722
1,705,723
Change text on link while loading
<p>I have a asp button that while processing i would like the text on it.. How could achieve that?</p> <pre><code>&lt;asp:LinkButton ID="loadImages" runat="server" CssClass="button" onclick="loadImages_Click"&gt;Load Images&lt;/asp:LinkButton&gt; </code></pre> <p>So when I click, it will change the Load Images to Loading... and then go back to the original state once it finishes.</p> <p>I would appreciate any ideas.</p>
c# asp.net
[0, 9]
505,239
505,240
Asp.net Custom Control pass object as a property
<p>In Asp.Net custom control i want to pass an object as a property (like we pass width / color) Is there anyway i can do that in design time?</p> <p>Example:</p> <p>Custom control is a &lt;asp:Panel&gt; and i would like to pass</p> <p><strong>&lt;cus:CustomPanel ID="Panel11" runat="server" CustomObject="student" /&gt;</strong></p> <p>student object is instantiated in code behind and my custom panel is coded like this</p> <pre><code>public class CustomPanel:Panel { [Browsable(true), Category("Data")] public object CustomObject { get; set; } } </code></pre>
c# asp.net
[0, 9]
3,466,599
3,466,600
Trigger JS on select elements with onChange, but also if it's already selected?
<p>I am writing a very basic website which involves the user to use a drop down menu to select an option, and it will play a sound when they do. </p> <p>This works fine if the user wants to pick a different option each time, but not if they play a sound from one <code>&lt;option&gt;</code>, then want to play it again by "selecting" it again. I say "selecting it again" because it's already selected, so clicking on the select box and picking the same option would not be onChange, which wouldn't trigger the event.</p> <p>How can you achieve it so that if you click on an <code>&lt;option&gt;</code>, it will execute that JS regardless if it is selected?</p> <pre><code>&lt;select onchange="document.getElementById(this.options[this.selectedIndex].value).play()"&gt; &lt;option&gt;Select&lt;/option&gt; &lt;option value="1"&gt;Sound one&lt;/option&gt; &lt;option value="2"&gt;Sound two&lt;/option&gt; &lt;option value="3"&gt;Sound three&lt;/option&gt; &lt;option value="4"&gt;Sound four&lt;/option&gt; &lt;/select&gt; </code></pre>
javascript jquery
[3, 5]
2,310,261
2,310,262
PHP Problem : filesize() return 0 with file containing few data?
<p>I use PHP to call a Java command then forward its result into a file called result.txt. For ex, the file contains this: "Result is : 5.0" but the function filesize() returns 0 and when I check by 'ls -l' command it's also 0. Because I decide to print the result to the screen when file size != 0 so nothing is printed. How can I get the size in bit ? or another solution available?</p>
java php
[1, 2]
4,629,096
4,629,097
Jquery changing the value of a drop-down using its value, not the text
<p>I'm having difficulty changing the calue of a dropdown menu using jquery.</p> <pre><code>&lt;div class="input-box"&gt; &lt;select name="options[4]" id="select_4"&gt; &lt;option value=""&gt;-- Please Select --&lt;/option&gt; &lt;option value="24"&gt;Not Sure - Send Me Some Samples First &lt;/option&gt; &lt;option value="13"&gt;1 Jet Black &lt;/option&gt; &lt;option value="14"&gt;Blondette 4/27 &lt;/option&gt; &lt;option value="15"&gt;Boho Blonde 613/12 &lt;/option&gt; &lt;option value="16"&gt;Caramel 6 &lt;/option&gt; &lt;option value="17"&gt;Cherry 530 &lt;/option&gt; &lt;option value="18"&gt;Dirty Blonde 612/12 &lt;/option&gt; &lt;option value="19"&gt;Ebony Black 1b &lt;/option&gt; &lt;option value="20"&gt;Hot Toffee 4 &lt;/option&gt; &lt;option value="21"&gt;LA Blond 24/613 &lt;/option&gt; &lt;option value="22"&gt;Malibu Blonde 60/613 &lt;/option&gt; &lt;option value="23"&gt;Raven 2 &lt;/option&gt;&lt;/select&gt; &lt;/div&gt; </code></pre> <p>I can't understand why this won't work</p> <pre><code>function changeIt(theId) { $j('.input-box:eq(0)').val(theId); } changeIt(22); </code></pre>
javascript jquery
[3, 5]
4,572,818
4,572,819
File permission while saving a html to server
<p>I have a problem , I want to save a html file in directory using asp.net . But when i try to do so , I got a security exception as follow . </p> <pre><code>7/10/2012 12:03:54 AM,http://www.teddytank.com/admin/AddNewsLetter.aspx? nid=3,System.IO.IOException: The process cannot access the file 'D:\hosting\7837152\html\ne\newsletter06_07_2012_T_37.html' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.Delete() at Admin_AddNewsLetter.Submit_Click(Object sender, EventArgs e) 7/10/2012 12:04:45 AM,http://www.teddytank.com/admin/AddNewsLetter.aspx? nid=3,System.IO.IOException: The process cannot access the file ' D:\hosting\7837152\html\ne\newsletter06_07_2012_T_37.html' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.Delete() at Admin_AddNewsLetter.Submit_Click(Object sender, EventArgs e) </code></pre> <p>Please help. thanx in advance.</p>
c# asp.net
[0, 9]
3,753,641
3,753,642
I don't understand what return does in programming?
<p>The question basically says it all. I'm a noob so make it gentle.</p>
java c++
[1, 6]
1,206,039
1,206,040
How to get website root path from another class
<p>I have asp.net web site (use web forms). I have a class called <code>FileHandler</code> and inside that class I want to get the root path of the site. </p> <p>Normally I use<code>Server.MapPath("~")</code> to get the path inside a web page. </p> <p>Here I cannot use that because it is not a Page. How can I get the path of the web site? </p> <p><strong>EDIT</strong><br> more about <code>FileHandler</code> class: <code>FileHandler</code> is a static class and I am going to assign root path of the site to a satic variable.</p>
c# asp.net
[0, 9]
1,011,964
1,011,965
filter an array with multiple values on same key
<p>I try to dynamically generate a listview in jQuery. This works perfectly for the whole list, but now I need to filter/search/reduce my initial data:</p> <pre><code>var rezepte = [ { "name" : "Eierkopf" , "zutaten" : ["Eier", "Zucker"] , "zubereitung" : "alles schön mischen." }, { "name" : "Käseschnitte" , "zutaten" : ["Käse", "Brot", "Paprika"] , "zubereitung" : "Käse drauf und in den Ofen" }, { "nme" : "Gemüse-Auflauf" , "zutaten" : ["Lauch"] , "zubereitung" : "1. schneiden 2. Kochen 3. essen" } ]; </code></pre> <p>I would like to filter/search "recipe" by a searcharray like <code>var searcharray = ["Zucker", "Paprika"]</code> resulting in:</p> <pre><code>var result = [ { "name" : "Eierkopf" , "zutaten" : ["Eier", "Zucker"] , "zubereitung" : "alles schön mischen." }, { "name" : "Käseschnitte" , "Zutaten" : ["Käse", "Brot", "Paprika"] , "zubereitung" : "Käse drauf und in den Ofen" }]; </code></pre> <p>I have tried a lot of things within the for loop: filter, map, push - but all without sucess always resuling in undefined objects.</p> <p>I am also not sure what syntax my recipe Array should be: there must be the possibility of variable amount of "ingredients".</p> <p>Any help and hint would be most appreciated.</p> <p>Thanks a lot, Andi </p>
javascript jquery
[3, 5]
4,900,672
4,900,673
Another jQuery version in function closure
<p>I'm developing some script, which developers will include on their pages. I need jQuery in this script. And if page already have jQuery, don't override them. I want to use my jQuery(in my anonymous function). And i want to page use jQuery whitch used before me(not my jQuery). Is it possible? Thanks.</p>
javascript jquery
[3, 5]
3,428,014
3,428,015
What is the best way to detect Internet Explorer 6 using JavaScript?
<p>What is the best way to detect Internet Explorer 6 using JavaScript?</p> <pre><code>If browser == IE6 { alert('hi'); } </code></pre>
javascript jquery
[3, 5]
5,091,579
5,091,580
Call an external PHP script on a website without using PHP
<p>My issue is following: My Partner's have websites and I want that partners can include a script from my server that dynamically generates a link and an image.</p> <p>i.e. myscript.php (on my server) generates following output:</p> <pre><code>&lt;a href="http://www.myserver.com/apples.php?12345"&gt; &lt;img src="http://www.myserver.com/images/12345.png" /&gt; &lt;/a&gt; </code></pre> <p>I don't want my partners to be bothered with any php scripting, hence the best solution for now is to supply them with an iframe, where the src is the link to my script on my server that generates the output above.</p> <p>However I clearly don't have any control over my partner's website and i.e. opening a lightbox out of the iframe certainly won't work.</p> <p>Because of that I tried a different approach. I used Ajax to dynamically load my script, however this also doesn't work due to ajax security features (you cannot call an external script via ajax - only if you do a php workaround).</p> <p>So basically, my question is: Is there any good solution to call <strong>my script</strong> on <strong>my server</strong> on the partner's website and display the generated code on my partner's website without the use of php?</p>
php javascript
[2, 3]
215,545
215,546
use $(this) in ajax callback jquery
<p>i'm doing a <code>jQuery.post</code> to a php file, and the file return's me a value.</p> <p>the question is: why the <code>$(this)</code> dosent work in the callback function ? any alert passing something to show, using <code>$(this)</code>, return's me <code>null</code></p> <pre><code>$(".class").live("focusout", function(){ jQuery.post("phpfile.php", { someValue: someValue }, function(data) { // why the $(this) dosent work in the callback ? } ) }); </code></pre>
javascript jquery
[3, 5]
798,282
798,283
how to call a jquery function from a c# application?
<p>I want to call a jquery function from a C# application. I have an idea how to do that as already did some research on it. But Im stuck on how to start with it.</p> <p>I added <code>System.Web.UI</code> in the references, but can only find <code>ClientScriptManager</code>, I dont see a <code>ScriptManager</code>, nor do I see a <code>ClientScript</code> as mentioned in some forums. So I began with this:</p> <pre><code>ClientScriptManager.RegisterStartupScript(this.GetType(), "jQuery", jsText, false); </code></pre> <p>but seemed like I need to get an object of <code>ClientScriptManager</code> to do this. So I created an object of <code>ClientScriptManager</code>:</p> <pre><code>ClientScriptManager csm = new ClientScriptManager(); </code></pre> <p>now I get an error saying <code>ClientScriptManager does not have a constructor</code>.</p> <p>Any help on how to proceed?</p> <p>Thanks</p>
c# jquery
[0, 5]
2,917,796
2,917,797
how to include id of json data in listview
<p>I'm trying to figure out how I can include an id for a listview item.</p> <p>Currently I am querying a rest api that returns a list of something similar to this.</p> <p>{ id : 100 name : "John Doe" }</p> <p>It the listview I display all the names and once someone click on one item it forwards it to another activity where I want to use the id and get more data for that particular user.</p> <p>So my questions are how can I get the ID and also pass the ID to the new activity. (The list is not sorted so the ids are not in order.)</p> <p>I've read about hidden textview values and also hash maps but not sure how to use them, could someone give an example please?</p>
java android
[1, 4]
3,944,765
3,944,766
jQuery doesn't add or remove class
<p>Why doesn't my jQuery code add and later remove loading class?</p> <pre><code>$('#crop').click(function (ev) { ev.preventDefault() $.post('frame.php?action=crop', dimensions, function (json) { $('body').addClass('loading') picture() }, 'json') $('body').removeClass('loading') }) </code></pre> <p>Chrome and Firebug consoles are empty, so there shouldn't be any errors. jQuery version is 1.4.4</p>
javascript jquery
[3, 5]
3,995,891
3,995,892
Code behind file not recognizing controls in *.ascx
<p>I have a QuestionControl.ascx and a QuestionControl.ascx.cs code behind file I copied to a new project. When I build the project any references in the code behind file to controls declared in the ascx gives me this error:</p> <blockquote> <p>'QuestionControl' does not contain a definition for 'rdbtnlstQuestion1' and no extension method 'rdbtnlstQuestion1' accepting a first argument of type 'QuestionControl' could be found (are you missing a using directive or an assembly reference?)</p> </blockquote> <p>This is at the top of my *.ascx:</p> <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="QuestionControl.ascx.cs" Inherits="QuestionControl" %&gt; </code></pre> <p>I've also tried CodeBehind:</p> <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuestionControl.ascx.cs" Inherits="QuestionControl" %&gt; </code></pre> <p>This is the top of my class in the codebehind file, it is not contained in a namespace:</p> <pre><code>public partial class QuestionControl : System.Web.UI.UserControl { </code></pre>
c# asp.net
[0, 9]
713,256
713,257
Why can't I use jQuery in amazon (in console)?
<p>using firebug console in firefox for example when execute this script</p> <pre><code>$("body").css("border","4px solid red"); </code></pre> <p>it will return an error with message:</p> <pre><code>TypeError: $("body") is null </code></pre> <p>same in chrome the error:</p> <pre><code>TypeError: undefined is not a function </code></pre> <p>any one knows why? and how to use it?</p>
javascript jquery
[3, 5]
4,544,400
4,544,401
Amend width of external poll once its submitted
<p>I've created a simple polldaddy poll. I'm amending the width &amp; hiding some elements of the poll once its loaded using jQuery as below : </p> <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".pds-pd-link").hide(); $(".a2a_dd.pds-share").hide(); $(".pds-box").width(220); }); &lt;/script&gt; &lt;script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/5968383.js"&gt;&lt;/script&gt; &lt;noscript&gt;&lt;a href="http://polldaddy.com/poll/5968383/"&gt;This is a test question ?&lt;/a&gt;&lt;/noscript&gt; </code></pre> <p>The problem is once I vote the width of the poll reverts back to its original width. Is it possible to retain the with at 220 ? I realise amending the width this way is a bit of a hack and its possible to do full customisations once a license is purchased. I just want to amend the width for now.</p> <p>Here is a fiddle for the poll : <a href="http://jsfiddle.net/Wx5mM/" rel="nofollow">http://jsfiddle.net/Wx5mM/</a></p>
javascript jquery
[3, 5]
2,096,107
2,096,108
how to alert browser from javaclass? is it possible?
<p>my scenario is that when ever my target is achieve i want to show alert in browser. while target was checked in javaclass side... </p> <p>i have a method in javascript like.</p> <pre><code>function targetAchieve(head,target,price) { alert(head+" Target Achieve"+"\n"+"Price:"+price+"\n"+"target: "+target+" \n" ); } </code></pre> <p>i want call this method from my java class</p> <pre><code>ltp = MOConstants.round(ltp, 2); if(ltp&gt;=target){ " here i want to call javascript's method" } </code></pre> <p>thanks in advance...</p>
java javascript
[1, 3]
3,738,914
3,738,915
How can I combine PHP and jQuery in paging controls
<p>I am trying to implement paging in PHP. First of all I am getting the number of pages as per page record and generating <code>&lt;li&gt;</code> links dynamically by number of pages. Like this:</p> <pre><code>for($i = 1; $i &lt;= $no_of_pages; $i++) { echo '&lt;li&gt;&lt;a href="view_records.php?pageno='.$i.'"&gt;'.$i.'&lt;/a&gt;&lt;/li&gt;'; } </code></pre> <p>It's fine, but the problem is that when the number of pages is more than 10, the page number wraps to the next line. I want to scroll them by clicking left and right 10 pages each time.</p> <p>Suppose I have 35 pages, so this will display all 35 pages links </p> <pre><code>left 1 2 3 4 5 6 7 8 9 10 11 12 ......35 right </code></pre> <p>But I want only</p> <pre><code>left 1 2 3 4 5 6 7 8 9 10 right </code></pre> <p>When I click on <code>right</code> this will scroll right and should display</p> <pre><code>left 11 12 13 14 15 17 18 19 20 right </code></pre> <p>Again <code>right</code> will display next 10 pages link. Is there anything in JS or jQuery to control that <code>li</code> for scrolling? It will be become easy because I get total no of pages by PHP and put link of them in HTML and user can directly move to desired page.</p>
php javascript jquery
[2, 3, 5]
1,536,925
1,536,926
how to make table of content in jQuery
<p>as I am beginer please tell me how I can make toc for my web page using jQuery. my page would look like this</p> <p>====== sample Table of Content ====</p> <blockquote> <p>Introduction |<strong>> What is Web |_</strong>> What is JavaScript Programming HTML5 |<strong>> Learn HTML5 |</strong>> Your First Example</p> </blockquote>
javascript jquery
[3, 5]
4,951,482
4,951,483
Link jQuery menu button to url
<p>I have this jQuery menu script:</p> <pre><code>&lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ jQuery('#promo').pieMenu({icon : [ { path : "/wp-content/themes/Tersus/images/piemenu/winamp.png", alt : "Winamp", fn : function(){alert('Click:: Find');return false} }, { path : "/wp-content/themes/Tersus/images/piemenu/vlc.png", alt : "VLC Media Player", fn : function(){alert('Click:: Plus');return false} },{ path : "/wp-content/themes/Tersus/images/piemenu/QuickTime.png", alt : "Quick Time Player", fn : function(){alert('Click:: Home');return false} },{ path : "/wp-content/themes/Tersus/images/piemenu/WMP.png", alt : "Windows Media Player", fn : function(){alert('Click:: Music');return false} },{ path : "/wp-content/themes/Tersus/images/piemenu/popup.png", alt : "נגן Popup", fn : function(){alert('Click: E-Mail');return false} },{ path : "/wp-content/themes/Tersus/images/piemenu/iTunes.png", alt : "iTunes", fn : function(){alert('Click: Config');return false} }); }) &lt;/script&gt; },{ </code></pre> <p>I need to link the icons to external URL when clicked, how can i achieve that?</p> <p>and i'm writing this line because it demands a better code explanation because the code is long...(?) </p>
javascript jquery
[3, 5]
1,311,287
1,311,288
How to use jQuery.map() on array of objects to return array of arrays
<p>I would like to use jQuery to convert an array of objects to array of arrays using map.</p> <p>For example if I have this:</p> <pre><code>var ObjArr = [{ a:1,b:2 },{ a:2,b:3 },{ a:3,b:4 }]; var ArrArr = $.map(ObjArr, function(n,i){ return [ n.a, n.b ]; }); </code></pre> <p>So that the result would be:</p> <pre><code>ArrArr = [[1,2],[2,3],[3,4]] </code></pre>
javascript jquery
[3, 5]
76,287
76,288
How to Compile projects in another console application
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3297427/place-all-output-dlls-in-common-directory-from-visual-studio">Place all output dlls in common directory from Visual Studio</a> </p> </blockquote> <p>I have a solution which is having 15 projects. Now i want to compile all these project and save dlls into another location using another console application.</p>
c# asp.net
[0, 9]
4,812,460
4,812,461
System.IO.File.Create locking a file
<p>Just as the question says... I'm using System.IO.File.Create to create a file. I'm not writting to it with a stream writer, just creating it.</p> <p>I get a server error in the front end when the app trys to open the newly created file - that the file is in use. Garbage collection then seems to come along and a few minutes later all is OK.</p> <p>Now I know if I was using Streamwriter I would have to close it. Does the same apply to creating?</p> <p>I've read that opening a stream writer to the file then immediately closing it will fix this but it seems messy. Is there a simpler way?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
2,919,093
2,919,094
selectedIndex - javascript on Google Chrome
<p>Can anyone please tell me why doesn't this work on Google Chrome:</p> <pre><code>val = document.form.option[document.form.selectedIndex].value; </code></pre> <p>How should I get around this so that other browsers (like IE and FF) don't get screwed up.<br> Many thanks in advance.</p>
javascript jquery
[3, 5]
2,021,096
2,021,097
How to bind Complex Entity type to Gridview using ObjectDataSource
<p>I have an entity</p> <pre><code>class Person { public int Age{get;set;} public string Name{get;set;} public Department Dept{get;set;} } class Department { public int DeptId{get;set;} public string DeptName{get;set} } </code></pre> <p>Now I binds Collection to GridView using ObjectDataSource Control. Under the TemplateField for Dept of Person class looks like</p> <pre><code>&lt;EditItemTemplate&gt; &lt;asp:DropDownList ID="cmbStatus" DataTextField="DeptName" SelectedValue='&lt;%# Bind("Dept.DeptId") %&gt;' DataValueField="DeptId" runat="server" CssClass="ddl150px ddlbg" DataSourceID="deptCollection" /&gt; &lt;asp:ObjectDataSource ID="deptCollection" runat="server" SelectMethod="GetDeptList" TypeName="LIMS.BusinessObject.Department" &gt; &lt;/asp:ObjectDataSource&gt; &lt;/EditItemTemplate&gt; </code></pre> <p>Now my Grid gets binded using </p> <pre><code> &lt;asp:ObjectDataSource ID="PersonCollection" runat="server" SelectMethod="GetPersonList" TypeName="LIMS.BusinessObject.Person" DataObjectTypeName="LIMS.DomainModel.Person" DeleteMethod="Delete" InsertMethod="Create" UpdateMethod="Update" ondeleting="PersonCollection_Deleting" onupdating="PersonCollection_Updating"&gt; &lt;/asp:ObjectDataSource&gt; </code></pre> <p>Now when I tries to update this Person entity, it throws error because dropdown displays Value field and text field and Person entity needs a Dept Entity which is actually binded to dropdownlist</p>
c# asp.net
[0, 9]
3,336,984
3,336,985
Adding a timeout to a javascript rotation
<p>I have the following code working (in Firefox &amp; Safari only - no worries it's a subtle effect that doesn't need perfect cross-browser compatibility).</p> <p>HTML</p> <p><code>&lt;span id="rotate_star"&gt;&lt;/div&gt;</code></p> <p>Javscript</p> <pre><code>&lt;script&gt; var count = 0; function rotate() { var elem2 = document.getElementById('rotate_star'); elem2.style.MozTransform = 'rotate('+count+'deg)'; elem2.style.WebkitTransform = 'rotate('+count+'deg)'; if (count==360) { count = 0 } count+=10; window.setTimeout(rotate, 30); } window.setTimeout(rotate, 100); &lt;/script&gt; </code></pre> <p>I'll be honest, I'm not the most savvy person in the world when it comes to javascript. I want this animation to repeat in an infinite loop but I want it to delay for 5 seconds every time it makes a complete 360 degree turn.</p> <p>Can anyone help?</p>
javascript jquery
[3, 5]
2,494,798
2,494,799
add new properties to an object in for loop
<p>How do you add more objects to an object on the fly in a for loop in JavaScript</p>
javascript jquery
[3, 5]
3,040,844
3,040,845
Is inputType="phone" limit the no of digits to take as inout
<p>I used <code>android:inputType = "phone"</code> to take phone number as input, but if i give six digits it takes otherwise force close and fires the error that </p> <blockquote> <p>"NumberFormat exception not valid int value"</p> </blockquote> <p>Actually i'm trying to convert that value to integer through:</p> <pre><code>phone = Integer.parseInt(phoneNumber.getText().toString()); </code></pre>
java android
[1, 4]