Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
|---|---|---|---|---|---|
5,451,979
| 5,451,980
|
Open a file using javascript, client-side
|
<p>In my application I want to open a file that exists on a client machine. I created two applications: desktop and web application. When the user installs the desktop application there are some files which is copied to its installation path, and I want to open those files from my web application via javascript.</p>
|
javascript asp.net
|
[3, 9]
|
1,636,224
| 1,636,225
|
Checking if browser is in fullscreen
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1047319/detecting-if-a-browser-is-in-full-screen-mode">Detecting if a browser is in full screen mode</a> </p>
</blockquote>
<p>Is there a way to check if a browser is currently in fullscreen mode (after the user pressed f11)?</p>
<p>Something like:</p>
<pre><code>if (window.fullscreen) {
// it's fullscreen!
}
else {
// not fs!
}
</code></pre>
<p>Thanks.</p>
<p>Steerpike's answer is pretty good, but my comment:</p>
<blockquote>
<p>Thanks a lot, but this answer is not
sufficient for FF. In Chrome I can set
a small tolerance, but in FF the
urlbar and tabs takes a while to
disappear, which means after pressing
f11, the detected window.innerWidth is
still too small.</p>
</blockquote>
|
javascript jquery
|
[3, 5]
|
1,408,079
| 1,408,080
|
Some @Override shows errors in Oracle Java but not in OpenJDK
|
<p>In a repository that was created in Ubuntu Linux and compiled under OpenJDK 6, when implementing LocationListener and SensorListener, adding the <code>@Override</code> tag above the inherited methods compiles fine.</p>
<p>But when the repo is cloned onto a Windows system with Oracle Java, some of the <code>@Override</code> generates errors. Example below:
<code>The method onAccuracyChanged(Sensor, int) of type ExpeditionActivity must override a superclass method</code></p>
<p>It seems that this error occurs only when you add <code>@Override</code> above a method that is inherited from implementing an interface. Adding <code>@Override</code> above a method inherited from a base class does not generate the error. This actually makes sense, because you are actually overriding the logic of the original method.</p>
<p>SO, is it syactically correct to write <code>@Override</code> above inherited interface methods?</p>
|
java android
|
[1, 4]
|
1,087,795
| 1,087,796
|
Get value of dom element in ready function
|
<p>I want my textArea to resize when the page is fully loaded. I found that</p>
<pre><code>$(document).ready(function() {
// Handler for .ready() called.
});
</code></pre>
<p>can help me, so I try to test it and put next code into that function:</p>
<pre><code>$(document).ready(function() {
var element = $('#elementId');
alert(element.value);
});
</code></pre>
<p>But when the page is loading, alert shows <strong>undefined</strong> value of textArea, however there is text inside it.
How can I fetch those value inside ready function?</p>
|
javascript jquery
|
[3, 5]
|
5,493,173
| 5,493,174
|
ASP.NET Application setting debug="false" in web.config breaks Javascript
|
<p>We have an application that works fine when we have debug="true" in Web.config, when we set this to "false" however the application stops working. It seems as if object inheritance is not working in the javascript (Microsoft JScript runtime error: Object doesn't support this property or method). Has anyone come across this before?</p>
<p>A bit more error detail:</p>
<p>a.beginUpdate() is not a function</p>
|
asp.net javascript
|
[9, 3]
|
1,749,931
| 1,749,932
|
For loop in jquery . I need to run scripts for 20 time each with with increment
|
<p>I have no idea about loop in jquery. I want the following code to be run as for loop from product1 to product20 and check the same if quantity1 to quantity20 have no value then set it to 1.</p>
<pre><code>$('#product1').change(function() {
if( $('#quantity1').val().length == 0 ){
$('#quantity1').val("1");
}
});
$('#product2').change(function() {
if( $('#quantity2').val().length == 0 ){
$('#quantity2').val("1");
}
});
</code></pre>
<p>Thank you in advance.</p>
|
javascript jquery
|
[3, 5]
|
1,202,647
| 1,202,648
|
executing 2 functions in one click handler
|
<p>how can I execute 2 functions at the same time. In the code snippet below with the onclick, I get the <code>id</code> of the parent Div and then execute a function using the <code>id</code>,</p>
<pre><code><div id="selDe">
<input type="radio" class="ger" id="num1" checked><label for="num1">
<input type="radio" class="ger" id="num2"><label for="num2">
</div>
<div id="selRe" >
<input type="radio" class="ger" id="num1" checked><label for="num1">
<input type="radio" class="ger" id="num2"><label for="num2">
</code></pre>
<p>JS:</p>
<pre><code><script>
$(".ger").on({
click:function(){
var pid = $(this).parent().attr("id"); //get the name of the div parent
$("#"+pid+" .ger").on({
//execute the function, but it just works after the next click
click: function () {
var showV = this.id.slice(3);
alert(showV)
}
});
}
});
</code></pre>
<p></p>
|
javascript jquery
|
[3, 5]
|
5,388,679
| 5,388,680
|
jQuery.map - Practical uses for the function?
|
<p>I am trying to get a better understanding of the <a href="http://docs.jquery.com/Utilities/jQuery.map" rel="nofollow">jQuery.map</a> function.</p>
<p>So in general terms .map takes a array and "maps" it to another array of items.</p>
<p>easy example:</p>
<pre><code>$.map([0,1,2], function(n){
return n+4;
});
</code></pre>
<p>results in [4,5,6]</p>
<p>I think I understand what it does. I want to under why would someone need it. What is the practical use of this function? How are you using this in your code?</p>
|
javascript jquery
|
[3, 5]
|
786,455
| 786,456
|
How to pass data from activity to broadcastReceiver?
|
<p>i have code that calls a broadcast receiver, in the receiver, i try to get the extra data from the intent, but it's null. </p>
<p>so,</p>
<pre><code> Intent intent = new Intent(MainActivity.this, CallAlarm.class);
intent.putExtra("medicine", "kkk");
PendingIntent sender=PendingIntent.getBroadcast(
MainActivity.this,0, intent, 0);
AlarmManager am;
am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP,
c.getTimeInMillis(),
sender
);
</code></pre>
<p>and in the BroadcastReceiver.onReceiver(),</p>
<pre><code> String name = i.getStringExtra("medicine");
</code></pre>
<p>but medicine is null. what am i missing?</p>
|
java android
|
[1, 4]
|
4,018,887
| 4,018,888
|
what's the jquery plugin that inserts text in a textbox, and it disappears upon focus?
|
<p>what's the jquery plugin that inserts text in a textbox, and it disappears upon focus?</p>
|
javascript jquery
|
[3, 5]
|
5,864,367
| 5,864,368
|
jQuery: Is it possible to assign a DOM element to a variable for later use?
|
<p>I'm working on a project that is using jQuery, which I'm much more familiar with Mootools.</p>
<p>I'll start with my code first.</p>
<pre><code>var customNamespace = {
status: 'closed',
popup: $('#popup'),
showPopup: function() {
// ...
}
}
$(document).ready(function(){
console.log($('#popup'));
console.log(customNamespace.popup);
console.log($(customNamespace.popup));
$('#popup').fadeIn('slow');
(customNamespace.popup).fadeIn('slow');
$(customNamespace.popup).fadeIn('slow');
});
</code></pre>
<p>My goal is to not have jQuery traverse the DOM everytime I want to do something with the #popup div, so I wanted to save it to a variable to use it throughout my script.</p>
<p>When the page loads, the console prints out the object 3 times as I would expect, so I assumed that for each method, the fadeIn would just work. But it doesn't, only</p>
<pre><code>$('#popup').fadeIn('slow');
</code></pre>
<p>Actually fades in the div.</p>
<p>Even if I remove my namespace hash, and just save the object to a global variable, and do a </p>
<pre><code>var globalVariable = $('#popup');
.
.
.
globalVariable.fadeIn('slow');
</code></pre>
<p>Also does not work as I thought it would. Can jQuery do what I am trying to do?</p>
|
javascript jquery
|
[3, 5]
|
2,835,933
| 2,835,934
|
Two Checkboxes Being Checked at the Same Time
|
<p>I have <strong>two checkboxes</strong>. What I need is when someone checks one of the boxes, it will <strong>automatically check the other one</strong> as well. And vice versa, if someone <strong>unchecks</strong> one of the boxes, it <strong>unchecks both</strong>. This is a bundle package on the form and they can not get one without the other. </p>
<pre><code><input type="checkbox" id="chk1" name="chk1" value="100">Voicemail<br />
<input type="checkbox" id="chk2" name="chk2" value="50">VM Support
</code></pre>
<p>Any help is greatly appreciated!</p>
|
javascript jquery
|
[3, 5]
|
1,211,873
| 1,211,874
|
jQuery image.onload phantom event firing
|
<p>I have stumbled across this insane behavior where image.onload gets fired multiple times instead of one.</p>
<p>It will be too long to explain this, so here is a jsfiddle example.</p>
<p>When you click the first time everything seems normal, but the issue begins after the second click and with every click it just LOOPS time and time again.</p>
<p><a href="http://jsfiddle.net/PP2dB/" rel="nofollow">http://jsfiddle.net/PP2dB/</a></p>
<p>The question is how to make this fire the image.onload only once per click?</p>
|
javascript jquery
|
[3, 5]
|
1,393,337
| 1,393,338
|
Automatic Timeout Web Client Use
|
<p>One of the problems I have come accross having complext tasks on the browser is with automatic timeouts. Currently our site has a sliding expiration of 30 minutes. Normally this isn't a problem because we use asp.net and most of the time the users update one or two fields and then submit the form. This obviously keeps the session active. I have struggled with how to handle this with significantly more complex forms/user interaction where there are few if no round trips to the server. Now users can view reports, type emails etc. on our site, and I am struggling with how to keep their session active while they're actually using browser but they are not actively posting information back. I would dispense with the sliding expiration, but it's a requirement, so I am stuck with it. Most of our users are outside of the organization, so I can't use any form of SSO. Does anyone have an elegant solution (I'll even go for an ugly one if it works), or am I out of luck?</p>
|
c# asp.net
|
[0, 9]
|
4,427,904
| 4,427,905
|
Using jquery to select an item from a select list based on the label
|
<p>So if I have a select list of lets say dates that looks like </p>
<pre><code><option value="624e70cb-2796-4029-bd09-2642abaa54b4">1989</option>
<option value="ff591d9a-e8a4-4280-829b-9307b7b41912">1988</option>
<option value="f2e9e756-7c59-4883-89b5-9c8cccf85ad6">1987</option>
<option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060">1986</option>
<option value="27aa2cd0-f77a-48c0-83f3-5348d5a7239f">1985</option>
<option value="50e375c0-a1fa-405e-8ec9-a3f220041a39">1984</option>
</code></pre>
<p>if I have a string that holds the value 86 is there a good way to select:</p>
<pre><code><option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060">1986</option>
</code></pre>
<p>with jquery?</p>
|
javascript jquery
|
[3, 5]
|
3,273,663
| 3,273,664
|
Resize HTML elements on Android orientation change
|
<p>I am trying to bind an event in Javascript to either the orientationchange or resize events in Android in order to change the width/height of some elements for my web app. In the event, I use window.innerHeight and window.innerWidth to get the current height and width of the window.</p>
<p>This works great on iOS and desktop devices, but on Android it seems that it calls this event before changing the values in the window variable. Therefore, when someone switches from portrait to landscape, I still get the values for portrait and therefore cannot resize correctly. Does anyone know what the problem is, and how I can fix it?</p>
|
javascript android
|
[3, 4]
|
3,292,119
| 3,292,120
|
Return a null from Function which returns a DateTime
|
<pre><code> public static DateTime ResolveDate()
{
return null;
}
</code></pre>
<p>Im required to return a <code>null</code> value from a function which returns a <code>DateTime</code> Type .. My Main Objective is to NOT to use <strong>MinValue</strong> or return a <code>new Datetime();</code> [Which Returns a Default Date] and Frontend display the Date as a Empty Value (Blank) -> <code>""</code> </p>
|
c# asp.net
|
[0, 9]
|
15,992
| 15,993
|
Android text coloring based on background
|
<p>I'm currently working on an Android app that has a progress bar with textView at it's edge showing a date.</p>
<p>When the progress bar's background is grey, and it's fill is blue. I need to have the text color change according to the progress bar behind it - aka letters that have the progress bar's fill behind them should be grey, but letters that are above the empty parts of the progress bar should be blue.</p>
<p>How can I achieve this sort of thing?</p>
<p>Thanks in advance.</p>
<p>EDIT:
here's the xml of the progress bar and textView:</p>
<pre><code><ProgressBar
android:id="@+id/progressBar"
android:layout_width="210dp"
android:layout_height="12dp"
android:layout_below="@id/contact"
android:layout_toRightOf="@id/row_image"
android:layout_marginTop="3dp"
android:layout_marginLeft="20dp"
style="@android:style/Widget.ProgressBar.Horizontal"
android:progressDrawable="@drawable/s6_bar" />
<TextView
android:id="@+id/dateStart"
android:layout_width="wrap_content"
android:layout_height="12dp"
android:textSize="10dp"
android:textStyle="bold"
android:textColor="#FF00FFFF"
android:layout_below="@id/contact"
android:layout_toRightOf="@id/row_image"
android:layout_marginTop="1dp"
android:layout_marginLeft="22dp" />
</code></pre>
<p>and I can't seem to post a picture because my rep is too low :(</p>
|
java android
|
[1, 4]
|
4,742,043
| 4,742,044
|
Jquery - onclick not triggered for dynamic created elements
|
<p>I have an issue, Jquery onclick not triggered for dynamic created elements. I am using Jquery 1.9 and tried the example with "ON" and "LIVE". But still its not working. can some 1 help me?. </p>
<pre><code>$("input[type=checkbox]").on("click", function (e) {..});
</code></pre>
<p>Demo: <a href="http://jsfiddle.net/cindrella_agi/6hjp9/2" rel="nofollow">Fiddle</a></p>
|
javascript jquery
|
[3, 5]
|
2,161,400
| 2,161,401
|
find all div's with contenteditable attribute in iframe and remove said attribute with jQuery?
|
<p>I have an ifram on a page with class ms-dlgFrame and in this iframe I want to remove contenteditable="true" on elements since it's not supported by Safari on iPad (I am checking the user agent first).</p>
<p>I have some issues with combining <code>.find(), .each(), .attr()</code>, and <code>.removeAttr()</code></p>
<p>I tried something like:</p>
<pre><code>console.log("iPad");
$('.ms-dlgFrame').contents().find("div").attr("contenteditable").each(function() {
$(this).removeAttr("contenteditable");
});
</code></pre>
<p>Any ideas?</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
2,115,294
| 2,115,295
|
how can I call a JS self-executing function later if I want?
|
<p>I am trying to write a function that executes immediately but can also be later like:</p>
<pre>
var test = function (e){ console.log('hello'+e); }();
$('#some_element').click(function(e){
test(' world');
});
</pre>
<p>where in this case, the results I would want would be:</p>
<pre>
helloundefined
hello world
</pre>
<p>I am not grasping why calling test later returns 'test is not a function'.</p>
|
javascript jquery
|
[3, 5]
|
4,412,254
| 4,412,255
|
How to extract only first url from text with javascript
|
<p>I have this regexp </p>
<pre><code>function isValidURL(text) {
var RegExp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
......
}
</code></pre>
<p>And text is: Please use <a href="http://google.com" rel="nofollow">http://google.com</a> or if nothing was found ask your question on <a href="http://stackoverflow.com">http://stackoverflow.com</a></p>
<p>And i need to extract only first url from text below. (http://google.com)</p>
<p>return as url</p>
|
javascript jquery
|
[3, 5]
|
3,699,708
| 3,699,709
|
Using "this" keyword when creating an eventhandler
|
<p>I have the following Java code:</p>
<pre><code>public class FirstActivity extends Activity implements OnClickListener
{
Button btn;
TextView textview;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
textview = (TextView)findViewById(R.id.textView2);
btn = (Button)findViewById(R.id.BtnGoToSecondActivity);
btn.setOnClickListener(this);
}
public void onClick(View v)
{
Intent secondActivityIntent = new Intent(this, SecondActivity.class);
secondActivityIntent.putExtra("Name", textview.getText());
startActivity(secondActivityIntent);
}
}
</code></pre>
<p>Every bit of code makes sense until I hit the "this" keyword in the example above.
I can't get my head around the "this" keyword used as an argument in the "setOnClickListener()" method call..
I haven't created an instance of any of the used classes above. How can I refer to an instance that is non-existing? Is the instance created automatically?</p>
<p>(I know what the "this" keyword is and what it does, but in this case I don't see the logic)</p>
|
java android
|
[1, 4]
|
4,317,308
| 4,317,309
|
Javascript dropdownlist.selectedIndex causing error in ASP.net page
|
<p>I'm trying to simply enable/disable a button based on whether a value has been selected from a dropdownlist, and for some reason javascript isn't getting the selected index of the dropdownlist. Here's the declaration of the drop down list:</p>
<pre><code><asp:DropDownList ID="ddlMyDropDownList" runat="server">
<asp:ListItem> </asp:ListItem>
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList>
</code></pre>
<p>In the code behind I'm adding the onChange attribute:</p>
<pre><code>ddlMyDropDownList.Attributes.Add("onchange", "enableButton();")
</code></pre>
<p>And this is what the enableButton function looks like, stripped down to the part that is causing problems:</p>
<pre><code>function enableButton() {
var ddl = document.getElementById('#<%= ddlMyDropDownList.ClientID %>');
alert("Testing");
var idx = ddl.selectedIndex;
};
</code></pre>
<p>As written the alert fires whenever I change the value of the drop down list. If I move the alert to after the idx line, however:</p>
<pre><code>function enableButton() {
var ddl = document.getElementById('#<%= ddlMyDropDownList.ClientID %>');
var idx = ddl.selectedIndex;
alert("Testing");
};
</code></pre>
<p>it doesn't fire, indicating that the ddl.selectedIndex is causing an error somehow. Why might this be occurring and how do I remedy it? Assuming I want to test only if the user has selected anything other than the first option, is there a better/easier way to do so?</p>
|
javascript asp.net
|
[3, 9]
|
2,624,459
| 2,624,460
|
is there any downside to add content text through javascript other than it will not shown when if javascrit is disabled?
|
<p>is there any downside to add content text through javascript other than it will not shown when if javascrit is disabled?</p>
<p>for example like this <a href="http://stackoverflow.com/questions/1899913/how-to-detect-linked-pdf-on-a-page-and-show-message-to-download-adobe-reader-usin/1899938#1899938">http://stackoverflow.com/questions/1899913/how-to-detect-linked-pdf-on-a-page-and-show-message-to-download-adobe-reader-usin/1899938#1899938</a></p>
<p>if text will not shown to javascript disabled use, no problem and i don't need this text for search engine. </p>
<p>Will it affect to page performance to end user?</p>
|
javascript jquery
|
[3, 5]
|
1,449,405
| 1,449,406
|
Word wrap in multiline textbox after 35 characters
|
<pre><code><asp:TextBox CssClass="txt" ID="TextBox1" runat="server"
onkeyup="CountChars(this);" Rows="20" Columns="35"
TextMode="MultiLine" Wrap="true">
</asp:TextBox>
</code></pre>
<p>I need to implement word-wrapping in a multi-line textbox. I cannot allow users to write more then 35 chars a line. I am using the following code, which breaks at precisely the specified character on every line, cutting words in half. Can we fix this so that if there's not enough space left for a word on the current line, we move the whole word to the next line?</p>
<pre><code>function CountChars(ID) {
var IntermediateText = '';
var FinalText = '';
var SubText = '';
var text = document.getElementById(ID.id).value;
var lines = text.split("\n");
for (var i = 0; i < lines.length; i++) {
IntermediateText = lines[i];
if (IntermediateText.length <= 50) {
if (lines.length - 1 == i)
FinalText += IntermediateText;
else
FinalText += IntermediateText + "\n";
}
else {
while (IntermediateText.length > 50) {
SubText = IntermediateText.substring(0, 50);
FinalText += SubText + "\n";
IntermediateText = IntermediateText.replace(SubText, '');
}
if (IntermediateText != '') {
if (lines.length - 1 == i)
FinalText += IntermediateText;
else
FinalText += IntermediateText + "\n";
}
}
}
document.getElementById(ID.id).value = FinalText;
$('#' + ID.id).scrollTop($('#' + ID.id)[0].scrollHeight);
}
</code></pre>
<h2>Edit - 1</h2>
<p><strong>I have to show total max 35 characters in line without specific word break and need to keep margin of two characters from the right. Again, the restriction should be for 35 characters but need space for total 37 (Just for the Visibility issue.)</strong></p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
5,716,230
| 5,716,231
|
Checking Time to allow form filling in PHP (and javascript)
|
<p>For a website, we have a form where a client enters in their ID number that sends them to a new page that allows them to make a request for our services. </p>
<p>We want to change it so that clients can only request our services from Tuesday-Friday from 12pm - 4pm. If they try to enter their id number during a time outside of Tuesday-Friday from 12pm - 4pm, it will tell them they cannot request our services. </p>
<p>What I want to do is that if the user accesses the page during times when they <strong>cannot</strong> make a request, an alert box (through javascript) will pop up telling them that. I also want to code something so that if they try to progres forward (clicking the create request button), they will not (though php). </p>
<p>I'm not sure how to check these times with PHP and Javascript in order to accomplish this. If anyone has any insight in how to do this, that would be fantastic. Thanks!</p>
|
php javascript
|
[2, 3]
|
1,938,313
| 1,938,314
|
ViewState to compare CheckBoxList Selected Values
|
<p>I have a button that creates a <code>CheckBoxList</code>. The items in the <code>CheckBoxList</code> are selected based on a user's current notification subscriptions. I'm storing the true or false value of the selected item.</p>
<p>After the users change their subscriptions by checking or unchecking a box in the <code>CheckBoxList</code>, they click another button to update their notification subscriptions. I need to compare the <code>Viewstate["PREV"]</code> with the changed selections on postback and run some functions based on the changes.</p>
<pre><code>ArrayList list = new ArrayList();
for (int i = 0; i < checkBoxList1.Items.Count; i++)
{
list.Add(checkBoxList1.Items[i].Selected.ToString());
}
ViewState["PREV"] = list;
</code></pre>
<p>Even though I can't see the values with a <code>Response.Write</code>, the values for the ViewState are correct when I add a watch in debug.</p>
<p>The problem I'm having is how to approach the next step to do the comparison. This is what I want to accomplish:</p>
<pre><code> for (int i = 0; i < checkBoxList1.Items.Count; i++)
{
//if checkbox state goes from false to true, subscribe to topic
//mySubscribeMethod
//else if checkbox state goes from true to false, unsubscribe to topic
//myUnsubscribeMethod
//else if checkbox state is unchanged, do nothing
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,370,732
| 4,370,733
|
Resize external javascript
|
<p>Can the below external javascript be resized ?</p>
<p>Below I have attempted to wrap it in a div and set the width on the div, but it is not resizing.</p>
<pre><code><div width = "100"><script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/23232.js"></script>
<noscript><a href="http://polldaddy.com/poll/23232/">Test</a></noscript>
</div>
</code></pre>
<p>Note, this poll does not acutally exist.</p>
|
javascript jquery
|
[3, 5]
|
4,973,175
| 4,973,176
|
Replace anchor tag onclick javascript function parameter
|
<p>I have a page which has a couple of anchor tags in this format:</p>
<pre><code><a onclick="javascript:RefreshPageTo(event, &quot;/web/Lists/exceptionlog/AllItems.aspx?Paged=TRUE&amp;PagedPrev=TRUE&amp;p_Created=20111026%2017%3a30%3a16&amp;p_ID=175\u0026PageFirstRow=1\u0026\u0026View={8AB948D3-7F13-4331-9F06-29C8480B1E80}&quot;);javascript:return false;" href="javascript:">
</code></pre>
<p>If you look at the RefreshPageTo javascript function it has a couple of arguments. The second argument is a server relative url. It has some querystrings, I need to append some more query strings to it. </p>
<p>Lets say for example I want to append the following query string to it: "FilterColumn=title&FilterValue=th". Any ideas how I would do this using jquery?</p>
|
javascript jquery
|
[3, 5]
|
1,316,805
| 1,316,806
|
Starting Java Source File from Android Activity
|
<p>I wrote a program to work from the console in Eclipse and the terminal window in Linux. I am now transforming it into an Android app and I have the basic functionality of the Android UI done up until the point where it needs to use the logic from the Java file of the program I wrote. All of my inputs from the Java file are currently from the keyboard (from Scanners).</p>
<p>My question is: how do I transform this to get it work with the user interaction of the app? </p>
<p>The only input would be from the built in <code>NumberPicker</code>. The Java file starts from the main method: <code>public static void main(String[] args) {</code>)</p>
<p>For example:</p>
<p>Sample Android Code:</p>
<pre><code>public class Source1 extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.source1_layout);
Intent intent = getIntent();
int pickerValue = intent.getIntExtra("numEntered", 0);
}
</code></pre>
<p>Sample Java Code from program (Test.java):</p>
<pre><code>public class Test {
public static void main(String[] args) {
System.out.println("Enter number: ");
Scanner reader = new Scanner(System.in);
int num = reader.nextInt();
...
}
}
</code></pre>
<p>How do I pass <code>pickerValue</code> into the main method of the <code>Test</code> class (starting the logic of the main method)? I want <code>num = pickerValue;</code> in the main method (replacing the <code>Scanner</code>). How is this done?</p>
<p>Also, will the print statements I have, <code>System.out.println(...);</code>, translate directly into the Android UI and print on the screen or do I have to modify those?</p>
|
java android
|
[1, 4]
|
5,064,307
| 5,064,308
|
Databound Value in href javascript link
|
<p>I've trawled the net looking for the syntax to get this working and i'm hoping this is a quick fix else i'll go mad. Basically I have a nested repeater and the button below hides another nested repeater.</p>
<p><code>((location_details)((RepeaterItem)Container.Parent.Parent).DataItem).tbl_location.location_id</code> evaluates perfectly well (3824 in the case i'm testing), but when I try to pass it so that its a string parameter for the javascript function it fails everytime.</p>
<pre><code><asp:Linkbutton ID="lb_showhide_oloc_gnotes" runat="server" Text="Expand/Close"
href='javascript:sltoggle('" + <%# ((location_details)((RepeaterItem)Container.Parent.Parent).DataItem).tbl_location.location_id %> +" '); return false;' />
</code></pre>
<p>Any ideas what i'm missing (I know the above syntax is wrong I must have changed it 100 times already but you get the idea).</p>
<p>thanks!</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,019,972
| 3,019,973
|
How do I convert this code to JQuery
|
<p>I've been trying to convert this code to jQuery from Javascript but to no avail. This code is for adding a new item to a list which I took from the <a href="http://msdn.microsoft.com/en-us/library/hh185011%28v=office.14%29.aspx" rel="nofollow">msdn</a> website.
It works in javascript but I need it to run every time the page is loaded. I tried to google for why it wasn't working with javascript and found <a href="http://sharepoint.stackexchange.com/questions/28534/javascript-to-display-sharepoint-list-items-on-page-load?rq=1">this</a>. The guy who asked the question said it worked well with jQuery. So, I've been trying to convert this.
All help is appreciated! Thanks!!
<br/>Note: As I'm working for a client, I'm not allowed to use third party tools like SPServices.</p>
<p>Edit: Code I've done till now:
</p>
<p></p>
<p>function createListItem() {</p>
<pre><code>var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle("Announcements");
var itemCreateInfo = new SP.ListItemCreationInformation();
this.oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item("Title", "My New Item!");
oListItem.set_item("Body", "Hello World!");
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
</code></pre>
<p>}</p>
<p>function onQuerySucceeded() {</p>
<pre><code>alert("Item created: " + oListItem.get_id());
</code></pre>
<p>}</p>
<p>function onQueryFailed(sender, args) {</p>
<pre><code>alert("Request failed. " + args.get_message() + "\n" + args.get_stackTrace());
</code></pre>
<p>}
$(document).ready(function()
{
createListItem();
});</p>
|
javascript jquery
|
[3, 5]
|
3,126,804
| 3,126,805
|
JS: Keeping user selection persistent across page reloads
|
<p>Lets say we have a side bar on a page. It has two tabs. When you click the unselected tab, the content below it in the sidebar instantly switches using jQuery. The old div is hidden, the new div is shown. Not a big deal. </p>
<p>Now that you've selected that div however, when you click to the next page, the history of that selection is lost, and you're back to the first default selected div.</p>
<p>How can I keep the action persistent?</p>
|
javascript jquery
|
[3, 5]
|
1,391,782
| 1,391,783
|
How to store the value in Session using jQuery?
|
<p>How to store this value in session?</p>
<p>My grid has 3 pages.. with page size 50 when I change this dropdown list box in first page it's doing perfect. but when I got to second page I am not seeing selected value for this dropdown list boxes?</p>
<p>Is there any way that we can maintain seession for this dropdownlist box value to send to the next page to set?</p>
|
javascript jquery
|
[3, 5]
|
3,060,903
| 3,060,904
|
How can I load a Class contained in a website from a DLL referenced by that website?
|
<p>Ok so this is alittle bit obscure and I'm not sure its the best way of doing what I'm trying to do but here goes.</p>
<p>Basically I have a Presentation Layer Dll in my web site which handles the Model View Presenter classes. The presentation layer also handles login for my website and then calls off to a web service. Currently whenever the presentation layer calls to a model it verifies the users details and if they are invalid it calls to a loginHandler which redirects the user to the login page. However I cannot dynamically load a new istance of the Login Page in my website from within my Presentation layer.</p>
<p>I've tried to use reflection to dynamically load the class but Since the method call is in the presentation assembly it is only looking within that assembly while the page I want to load is in the website.</p>
<p>heres the reflection code that loads the View:</p>
<pre><code>public ILoginView LoadView()
{
string viewName = ConfigurationManager.AppSettings["LoginView"].ToString();
Type type = Type.GetType(viewName, true);
object newInstance = Activator.CreateInstance(type);
return newInstance as ILoginView;
}
</code></pre>
<p>Anyone got any suggestions on how to search within the website assembly? Ideal I don't want to tie this implementation into the website specifically as the presentation layer is also used in a WPF application.</p>
|
c# asp.net
|
[0, 9]
|
4,643,875
| 4,643,876
|
Jump into Android or learn Java basics first?
|
<p>I am quite proficient in C and know some C++, but never touched Java. Recently I got an idea for an app which I think has potential, and I want to develop it. </p>
<p>I am planning to go Android first, cause it doesn't require a mac/iPhone. </p>
<p>So my question is: can I go straight to learning Android development, picking up the Java syntax as I go along and need it (after all I don't think it's much different from C/C++), or should I take a couple of weeks to learn the basics of Java first and then start with Android development?</p>
|
java android
|
[1, 4]
|
299,033
| 299,034
|
How can I briefly flash a rectangle around a form?
|
<p>What I want to do is when a user clicks something:</p>
<pre><code><div id="FormContainer">
<form>
...
</form>
</div>
<a href="#" onClick="FlashElement()">Make it flash</a>
</code></pre>
<p>It briefly flashes a rectangle around the form within the <code>FormContainer</code>. Is there any way I can achieve this?</p>
|
javascript jquery
|
[3, 5]
|
1,731,925
| 1,731,926
|
Accessing Class Properties in ASP.NET
|
<p>I have 2 C# classes: </p>
<pre><code>public class Course
{
public string Title{get;set;}
public int Code {get;set;}
}
public class Student
{
public int Id{get;set;}
public string Surname{get;set;}
public Course Course {get;set}
...
}
</code></pre>
<p>As you can see the Student class contains a reference to Course. I have a method in my application to return me a student object. In my ASP.NET .aspx file I have the following code:</p>
<pre><code>...
<columns>
<asp:BoundField DataField="Id" HeaderText="Id"/>
<asp:BoundField DataField="Surname" HeaderText="Surname"/>
...
</columns>
...
</code></pre>
<p>How do I access the values of the Course property in the Student class (i.e. how do I get the course code and title for the current student).</p>
|
c# asp.net
|
[0, 9]
|
5,343,204
| 5,343,205
|
best way to build dyanmic pop up menus
|
<p>I have a scheduling page that display a week (sunday to saturday) schedule.</p>
<p>They way I want to add employees to this schedule is with a series of popup menus that change based on the values selected.</p>
<p>For example the first menu will be Jobs with <code><option></code> values propagated from the jobs table in my db.</p>
<p>Now say a user selects 'Cook' in the Jobs popup menu. The next menu 'Employees' will show all the employees from the employees table that have the job code of 'cook' set. Thus showing me all the cooks that would be available that day.</p>
<p>What is the best way to make a series of menus like this?</p>
<p>Any links to quality tutorials would be appreciated.</p>
|
php javascript
|
[2, 3]
|
3,732,425
| 3,732,426
|
Problem with displaying my Image
|
<p>Here is my full problem so if anyone has any ideas or can offer some help, please let me know. I have a Website that will generate a Report and this Report takes some time to create. There is a MyReport.ASPX file that has a form1, Image1, and a ReportViewer control. There is also a MyReport.cs file that has C# code to generated a HTMLText string that the ReportViewer control will display. When I pull the Website up in the browser, the MyReport.cs file creates the Report before MyReport.ASPX ever gets called so my Image1 (which I need to display while the Report is being created) never gets displayed until AFTER the Report is created and displayed.</p>
<p>What do you suggest I do here? If I did not supply enough information, please let me know what else you need to know and I will gladly post it.</p>
<p>Thanks,</p>
<p>The below is in response to Derek.</p>
<pre><code><script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$(".loading").load("http://servername/Geocortex/Essentials/Web/SelectionReport1.aspx");
});
</script>
<%@ Page Language="C#" AutoEventWireup="true" Codebehind="App_Code/MyReport.cs" Inherhits="Geocortex.Essentials.WebFramework.SelectionReportPage" Culture="auto" UICulture="auto" %>
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,120,037
| 1,120,038
|
Fading out a div and refreshing the page using jQuery
|
<p>Given that I have a button within a div:</p>
<pre><code><div id="result">
<a href='#task5'>
<img src='resources/book.png' style='padding-top: 10px;'
class='button3'>
</a>
</div>
</code></pre>
<p>How would I use jquery or javascript to: </p>
<p>1) Fade out the div </p>
<p>2) Refresh the page</p>
<p>3) Automatically jump to an anchor called #t5 on the page</p>
<p>This is what I have so far but I'm having difficulty jumping to an anchor called t5:</p>
<pre><code>$(".button4").click(function (){
$("#result").fadeOut(function(){
location.reload();
})
})
</code></pre>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
4,878,173
| 4,878,174
|
Getting "invalid assignment left-hand side"
|
<p>In my JavaScript file I'm trying to load an external API JavaScript and calling function in callback. Its returning "invalid assignment left-hand side" on second line <code>window.loadApi = function(callback) {</code>. Totally confuse because syntactically it is looking okay.</p>
<pre><code>var apiUrl = window.location.protocol + "my url";
window.loadApi = function(callback) {
if (window.$MY) {
callback();
} else {
$.getScript(apiUrl, function() {
$($MY.docReady);
callback();
});
}
};
loadApi(function() {
//my function
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,008,371
| 5,008,372
|
Is it possible to conclude the code in a loop?
|
<p>I have 25 elements on this page: </p>
<pre><code><div id="test1"></div>
<div id="test2"></div>
<div id="test3"></div>
<div id="test4"></div>
<div id="test5"></div>
</code></pre>
<p>Also I have code for update html in divs:</p>
<pre><code>setInterval(function() {
$.post("./main/", {
record:1,
opt:'get_res'
}, function(data){
$test1=data;
});
}, 15000);
</code></pre>
<p>To change the html in all the blocks I need to run this code 5 times, ex:</p>
<pre><code>setInterval(function() {
$.post("./main/", {
record:1,
opt:'get_res'
}, function(data){
$test1=data;
});
}, 15000);
setInterval(function() {
$.post("./main/", {
record:2,
opt:'get_res'
}, function(data){
$test2=data;
});
}, 15000);
.....
.....
setInterval(function() {
$.post("./main/", {
record:3,
opt:'get_res'
}, function(data){
$test3=data;
});
}, 15000);
</code></pre>
<p>For example for 25 elements div need write this code 25 times - it will be been very big code.</p>
<p>Tell me please whether implementation of the code in a loop, so as not to repeat it several times?</p>
|
javascript jquery
|
[3, 5]
|
3,867,711
| 3,867,712
|
alerting user on other user login with jquery ajax
|
<p>how can i alert the user already logged in for the new user logged in........suppose....</p>
<p>user1 one is currently logged in and user2 is offline.
i want to alert user1</p>
<p>when user2 logged in............</p>
<p>how can i achieve this</p>
|
php jquery
|
[2, 5]
|
4,693,113
| 4,693,114
|
How to Add Data Contents to Data Grid in the Same Page without any Database Connectivity?
|
<p>Say, I have a TextBox - When the User enters contents into TextBox and Click on Add the Content Should Populate in the DataGrid Without any db connectivity. The User Can add repeated items in the TextBox and Click on Add, So Every Value gets Popluated in the Grid.
How do I achieve this?</p>
|
c# asp.net
|
[0, 9]
|
3,988,177
| 3,988,178
|
How to hide and show keyboard on tablets
|
<p>When i run my app on a keyboard phone it works fine and it looks good but when it is run on the tablet the keyboard screen stays up and i want to hide it when i am done with user input. Is there a way to hide/show the keyboard? All relevent answers are appriciated!</p>
<p>Update: i also want to be able to detect weither the keyboard is being shown or not</p>
|
java android
|
[1, 4]
|
918,257
| 918,258
|
change css classes of element added to DOM at runtime
|
<p>I've included some JavaScript from a third party in my page. This adds the following element to the page some time after the page is loaded:</p>
<pre><code><a class="foo">some link</a>
</code></pre>
<p>I need to ensure that this is changed to:</p>
<pre><code><a class="bar">some link</a>
</code></pre>
<p>ASAP after the element is added to the page. I tried adding the following to a JQuery ready handler</p>
<pre><code>$('a.gullSearchBtn').removeClass('gullSearchBtn').addClass('roundButton');
</code></pre>
<p>But this executes before the element is added and therefore doesn't work. I've searched the web and it seems like the jQuery feature known as "livequery" might be the solution to my problem, but I can't seem to get it to work.</p>
|
javascript jquery
|
[3, 5]
|
60,604
| 60,605
|
How to get cookie value with javascript or jquery
|
<p>I am getting following cookie values on my home page.</p>
<blockquote>
<p>vsettings=HiddenNotifications=%2C19%2C;
(referral)|utmcmd=referral|utmcct=/;
ASPSESSIONIDQCSBCCAD=LFLGDKACEGPCPFGBANHFFBMK;
ASPSESSIONIDSASDCCDA=OFEHPJACGHNKICDLFBOCJNNH;
ASPSESSIONIDQCSDDCBC=LGFPBDLCKHLIOLPMCAGJNFIM;
ASPSESSIONIDQCTACBAC=DCIPJDLCNDBEGEIIELCGFMDP;CustomerID;
ASPSESSIONIDSCTCAABD=LHPFFLFDEMIBIENBMGMLFIFP;
ASPSESSIONIDSAQDDDAD=HMCDMLFDFCLJCIBHMEHPNHME; s_cc=true;
__utmc=97358351; CustomerID=755B031ED8C016EC4F90D6F3127E776AE202DEF5BC6EB9F7A9BB19E49323BC3B;
ASPSESSIONIDQCSDBDAC=CFBDJEAAPJJGHMDGOCCHALHC;
ASPSESSIONIDSASCBDAD=FLGJHFAAJAJBICGIMOOJEFFF;Session%5FToken=C8F2A63C3BBA4E39BBF73B83C108D1C6</p>
</blockquote>
<p>I want get the value of CustomerID cookie.
Using jquery I wrote this:</p>
<pre><code>$.cookie('CustomerID',{ path:'/'});
</code></pre>
<p>But I am not getting the value for cookie - it is showing me blank.</p>
<p>How can I get the CustomerId cookie?</p>
|
javascript jquery
|
[3, 5]
|
2,700,031
| 2,700,032
|
timestamp convertion in java (windows OLE (64 bit Double) to human readable format
|
<p>i want to convert windows :OLE(64 bit Double) ie.., "FBE8DF975D3FE340" to human readable format ie.., Mon, 03 December 2007 03:41:42 +0530 so there is algorithm to convert it which i am not getting. for refference <a href="http://www.digital-detective.co.uk/freetools/decode.asp" rel="nofollow">http://www.digital-detective.co.uk/freetools/decode.asp</a> where the example time and converted time in java.</p>
<p>thanks in advance</p>
|
java android
|
[1, 4]
|
4,770,624
| 4,770,625
|
How to click some parts of an image
|
<p>I need to make an index page only with the following image. </p>
<p>When the user clicks the water between the flags, he can continue to the next page. If the user presses at any other location, an alert message will be shown. Do we have any x-axis,y-axis concept in PHP? </p>
<p>Anyone have any idea how to make an image's some parts clickable? Anyone can provide me examples or links to documents?</p>
<p>Thanks!</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,880,998
| 2,880,999
|
How do I tell programatically if I am running under Medium Trust?
|
<p>In C# how do I tell if my assembly is running under medium trust in asp.net? Is there something similar to Debugger.IsAttached for this?</p>
|
c# asp.net
|
[0, 9]
|
4,496,139
| 4,496,140
|
jquery select link by name
|
<p>i can reference link with specific id with following code</p>
<pre><code> $(document).ready(function(){
$("a#example_link_id").click(function(event){
var url = $(this).attr("href");
get_uid(url);
//event.preventDefault();
});
});
</code></pre>
<p>is it possible to use <code>$("a#example_link_id")</code> this by link name </p>
|
javascript jquery
|
[3, 5]
|
2,212,494
| 2,212,495
|
Write a file in SDcard in Android
|
<p>I have been searching this problem.
It actually worked in older version of android, but after I updated SDK, I get an error.
Error message is "open filed: ENOTDIR (Not a directory): /sdcard/PlayNumbers/mysdfile.xml"
Can please someone point me what I did wrong??
My codes are below.</p>
<p>Many Thanks,</p>
<pre><code>path=new File("/sdcard/PlayNumbers");
myFile = new File(path,"mysdfile.xml");
if (!path.exists()) {
path.mkdirs();
}
if(!myFile.exists()){
myFile.createNewFile();
}
FileOutputStream fOut = new FileOutputStream(myFile);
OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);
myOutWriter.append("test");
myOutWriter.close();
fOut.close();
</code></pre>
<p>==></p>
<pre><code>File path = null;
File myFile = null;
String filePath = Environment.getExternalStorageDirectory().toString();
path=new File(filePath+"/PlayNumbers/");
myFile = new File(path,"mysdfile.xml");
//i also tried both as below
//path=new File(filePath+"/PlayNumbers");
//myFile = new File(path,"mysdfile.xml");
if (!path.exists()) {
path.mkdirs();
}
if(!myFile.exists()){
myFile.createNewFile();
}
FileOutputStream fOut = new FileOutputStream(myFile);
OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);
myOutWriter.append("test");
myOutWriter.close();
fOut.close();
</code></pre>
<p>p.s. ok, I have changed as you guys mentioned like my code, but it still gives me same error that it is not directory... any idea???</p>
|
java android
|
[1, 4]
|
4,436,404
| 4,436,405
|
How to make Javascript object available outside function?
|
<p>I am retrieving some JSON data with the following function. It is called when an element is clicked and the data is used to create a table, populate the cells with images and append the table to a div.</p>
<pre><code>function LoadImagesByCategory() {
$.getJSON("/Service/GetJson.ashx?data=images", function(data) {
jsObjectData = data.ImageCollection.Images;
//Create a table named imageTable
$("#imagesByCategory").append(imageTable);
}
})
</code></pre>
<p>the jsObjectData looks like this. </p>
<pre><code>{"ImageCollection":
{"Images":
[{ "ImageID":"68",
"CatID":"1",
"Name":"uploadedFile",
"Location":"/Images/Art/Full/68.gif",
"ClipLocation":"/Images/Art/Clips/68.gif",
"FullHeight":"504",
"FullWidth":"451"
},
{ "ImageID":"69",
"CatID":"1",
"Name":"uploadedFile",
"Location":"/Images/Art/Full/69.gif",
"ClipLocation":"/Images/Art/Clips/69.gif",
"FullHeight":"364",
"FullWidth":"500"
},
etc. etc
]
}
}
</code></pre>
<p>It contains additional info about the images like the FullHeight and the FullWidth that I would like to be able to retrieve when an img is clicked.
For example if I made the id of the img something like "68ArtImage" where 68 is the ImageID I would like to be able to pass the 68 into a function attached to the jsObjectData and retrieve the corresponding Image Data.
The problems are first that I don't know how to make the object avail. outside the function and second I don't know how to attach the function to the object.</p>
|
javascript jquery
|
[3, 5]
|
2,834,853
| 2,834,854
|
Upload file in asp, AJAX
|
<p>where error? if i dont use ajax, then form is valid, and file is uploading, but now page reload and...file not load in path, why?</p>
<p>
</p>
<pre><code> <asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<p>
<asp:FileUpload ID="FileUpload1" runat="server" />
&nbsp;<asp:Button ID="Button1" runat="server" onclick="Upload" Text="downdoad..."
BackColor="#0099CC" Font-Size="Small" />
</p>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
downdoad...
</ProgressTemplate>
</asp:UpdateProgress>
</code></pre>
|
c# asp.net
|
[0, 9]
|
833,472
| 833,473
|
How to determine if it is day or night in javascript or jquery?
|
<p>Im wanting to apply different CSS sheets to my site depending on the time of the browser. e.g if its day time, display day.css or night.css for night.</p>
<p>I can do this with PHP but it is based on the server time, not the browsers local time.</p>
<p>Is there a way to tell the time in javascript? I'm probably going to use jQuery to simply initiate the css once its worked out.</p>
|
javascript jquery
|
[3, 5]
|
1,452,963
| 1,452,964
|
How to develop a Query Refinement tool using C# / Asp.Net
|
<p>Want to develop a query refinement tool just like Google Suggest so that i will get recommended options when i enter keywords in the search textbox i.e( if i type "car"
i will get the recommended options as rental cars,used cars,cars for sale etc) want to develop the tool in c#/ASP.Net dont know where to start.please give some suggestions.</p>
|
c# asp.net
|
[0, 9]
|
1,331,698
| 1,331,699
|
How to dynamically include all scripts in a page using body onload event
|
<p>I am trying to include a page (a.xhtml) using <code><ui:include></code> inside <code><rich:dataTable/></code>. The included page contains a script to load a image. Based on the number
of iterations script will be included with different function names. I want
to call all the javascript function in a page on body onload event. How to do this?</p>
<p>My code will look like this </p>
<p><strong>a.xhtml</strong></p>
<pre><code> <f:subview>
<canvas id="#{canvasId}"/>
<script>
function #{fnName}() {
...
}
</script>
</f:sunView>
</code></pre>
<p><strong>b.xhtml</strong></p>
<pre><code><rich:panel>
<html>
<body>
<tich:dataTable var="item" value=#{items}" rowKeyVar="num">
<rich:column>
<ui:include src="a.xhtml"
<ui:param name="canvasId" value="img_#{num}"/>
<ui:param name="fnName" value="fn_#{num}"/>
</ui:include>
</rich:column>
<rich:dataTable>
</body>
</html>
</rich:panel>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,823,764
| 4,823,765
|
Inconsistent variable output
|
<p>A few days ago I made a lord generator for a game called Broken History I play with my mates, I started the code myself but ended up getting help with the code to finish it. </p>
<p>I then set about making a char gen for the same game, using the exact same methods that worked before, everything was looking good every element did what it was supposed to. However, when I got the resulting text the first time the variable curFaction was called it read <code>undefined</code> the second time it read the faction the user chose in the select box i.e. <code>Saxathia</code>. The variable is assigned in the <code>$(document).ready()</code> function so in theory is should be assigned before it is called right?</p>
<p>I can't think why this happens, the variable is called as part of an array does that make any difference?</p>
<p><img src="http://i.stack.imgur.com/ecMLn.jpg" alt="enter image description here"></p>
<p>Here is the jsLint <a href="http://jsfiddle.net/CYe8J/31/" rel="nofollow">http://jsfiddle.net/CYe8J/31/</a></p>
|
javascript jquery
|
[3, 5]
|
3,977,499
| 3,977,500
|
Which is faster, int to String or String to int?
|
<p>This may seem like a fairly basic question, for which I apologise in advance.</p>
<p>I'm writing an Android app that uses a set of predefined numbers. At the moment I'm working with <code>int</code> values, but at some point I will probably need to use <code>float</code> and <code>double</code> values, too.</p>
<p>The numbers are used for two things. First, I need to display them to the user, for which I need a <code>String</code> (I'm creating a custom <code>View</code> and drawing the <code>String</code> on a <code>Canvas</code>). Second, I need will be using them in a sort of calculator, for which they obviously need to be <code>int</code> (or <code>float</code>/<code>double</code>).</p>
<p>Since the numbers are the same whether they are used as <code>String</code> or <code>int</code>, I only want to store them once (this will also reduce errors if I need to change any of them; I'll only need to change them in the one place).</p>
<p>My question is: should I store them as <code>String</code> or as <code>int</code>? Is it faster to write an <code>int</code> as a <code>String</code>, or to parse an <code>int</code> from a <code>String</code>? My gut tells me that parsing would take more time/resources, so I should store them as <code>int</code>s. Am I right?</p>
|
java android
|
[1, 4]
|
5,877,162
| 5,877,163
|
How to get day of the month?
|
<p>I am trying to retrieve which day of the month it is.</p>
<p>Such as today is August 29,2011.</p>
<p>What i would like to do is just get the days number such as 29, or 30. Which ever day of the month it is. </p>
<p>How would i go about doing this?</p>
|
java android
|
[1, 4]
|
818,248
| 818,249
|
How to Pass a parameter form button click to Jquery Function
|
<pre><code>protected void Button3_Click(object sender, EventArgs e)
{
string val = TextBox1.Text;
string location = Server.MapPath(".");
SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT ISNULL(MAX(MODIFIED_NO),0) FROM FORM_NAME WHERE FRM_NME='" + TextBox1.Text + "'", con);
con.Open();
object modifyno = cmd.ExecuteScalar();
con.Close();
}
</code></pre>
<p>Here I want to pass the "modifyno" as parameter to Jquery Function</p>
<pre><code>function check(modifyno ) {
if (modifyno == "1") {
document.getElementById('Autolbl').value = "100";
document.getElementById('Autotxt').value = "100";
}
if (modifyno == "2") {
document.getElementById('Autolbl').value = "200";
document.getElementById('Autotxt').value = "200";
}
}
</code></pre>
<p>How i can call the function by passing parameters of modifyno...
please help me soon..</p>
|
c# jquery
|
[0, 5]
|
5,692,819
| 5,692,820
|
Convert bool? to Yes/No/null string
|
<p>i have an object that as a parameter bool?</p>
<p>i need to show it on a repeater.</p>
<pre><code><%# Eval("LS_Body_Connection") %>
</code></pre>
<p>i create a class </p>
<pre><code>public static class BooleanExtensions
{
public static string ToYesNoString(this bool value)
{
return value ? Resources.Yes : Resources.No;
}
}
</code></pre>
<p>how to use it on the repeater?</p>
<p>i try </p>
<pre><code>((bool)Eval("LS_Body_Connection")).ToYesNoString()
</code></pre>
<p>but it's not recognaize</p>
<p>'bool' does not contain a definition for 'ToYesNoString' and no extension method 'ToYesNoString' accepting a first argument of type 'bool' could be found (are you missing a using directive or an assembly reference?)</p>
<p>in the cs of the page i can call the extension method</p>
<p>when i add </p>
<pre><code><%@ Import Namespace="IDD.App_Code" %>
</code></pre>
<p>i get
The call is ambiguous between the following methods or properties: 'IDD.App_Code.BooleanExtensions.ToYesNoString(bool?)' and 'IDD.App_Code.BooleanExtensions.ToYesNoString(bool?)'</p>
|
c# asp.net
|
[0, 9]
|
3,713,977
| 3,713,978
|
Is it possible to secure cookies?
|
<p>I am using JQuery.cookies to manage cookies. I am storing objects and user/login informations.</p>
<p>Is there a way to encrypt or secure the cookies? or is it possible with SSL only?</p>
|
javascript jquery
|
[3, 5]
|
441,829
| 441,830
|
python to php conversion
|
<p>I'm trying to convert parts of a python script into php. I know most of it, but I've run into something to do with bitshifting (i think?) which I don't have much experience in even in PHP! Can somebody translate this python function into php please?</p>
<pre><code>def setBit(value, position, on):
if on:
mask = 1 << position
return (value | mask)
else:
mask = ~(1 << position)
return (value & mask)
</code></pre>
|
php python
|
[2, 7]
|
13,719
| 13,720
|
jquery resize li based on a string size
|
<p>I have some query which will calculate the pixel width for each li.
problem is it doesnt take into consideration the amount of characters in an A href.</p>
<p>You might get "Cartouches/Réservoirs" and it will attempt to assign 124px width based on the calculation of the other items.</p>
<p>I need to check first if the number of characters will fit in the assigned size, if they dont then increase the size by remove some from an LI that has sufficient space.</p>
<pre><code>$('div#new-menu-lower ul li').css('width', ($('div#new-menu-lower ul').width() / $('div#new-menu-lower ul li').length));
$(function() {
var menuWidth = $('div#new-menu-lower ul').width();
var listItems = $('div#new-menu-lower > ul > li').length;
var itemWidth = Math.floor(menuWidth * (1/listItems)) - 20;
$('div#new-menu-lower ul li').css('width', itemWidth);
});
</code></pre>
<p>Here is the demo: <a href="http://jsfiddle.net/zwqYf/3/" rel="nofollow">http://jsfiddle.net/zwqYf/3/</a></p>
<p>As you can see when you hover the items are broken.</p>
<p>Is there anyway to get round this?</p>
|
javascript jquery
|
[3, 5]
|
1,188,236
| 1,188,237
|
Error in Javascript code?
|
<p>What is wrong in this code? it shows an Syntax error in <code>eval(e.text); //run the script</code></p>
<pre><code> runScripts1: function(e) {
if (e.nodeType != 1) return false; //if it's not an element node, return
if (e.tagName.toLowerCase() == 'script') {
eval(e.text); //run the script
}
else {
var n = e.firstChild;
while ( n ) {
if ( n.nodeType == 1 ) forrester.runScripts1(n); //if it's an element node, recurse
n = n.nextSibling;
}
}
return true;
},
</code></pre>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
5,524,177
| 5,524,178
|
Reload tab in android
|
<p>I have tabhost in my application(2 tabs),when i select tab2 the content has been dislayed has a list view ,again i have list click event here to move further another list view,here the 2tab already in selected mode and it's focus not been changed,when i click the 2tab again i need it to reload its content has loaded initially with first list view content.how can i get it. </p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TabHost tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("tab1")
.setIndicator("OPT")
.setContent(new Intent(this, TabGroup1Activity.class)));
tabHost.addTab(tabHost.newTabSpec("tab2")
.setIndicator("EDIT")
.setContent(new Intent(this, TabGroup2Activity.class)));
tabHost.setCurrentTab(1);
}
</code></pre>
|
java javascript android
|
[1, 3, 4]
|
3,458,670
| 3,458,671
|
Is getElementsByTagName a safe call to make accross all browsers?
|
<p>Just looking at other peoples .js code to learn from, and this site that uses jquery actually makes references to:</p>
<pre><code>document.getElementsByTagName
</code></pre>
<p>I'm guessing this is faster that using a jqeury selectory, is it safe accross all browsers?</p>
|
javascript jquery
|
[3, 5]
|
3,139,521
| 3,139,522
|
Merge two JavaScript objects
|
<p>I've got a big JavaScript object literal I am reusing with very few modifications each time. It would be good to make a variable containing most of the object, then reference that each time I need it.</p>
<p>But how can I do that? I tried to do this, but it didn't work:</p>
<pre><code>var settings = {
legend: {
enabled:false
},
yAxis: {
title: {
text: 'Impact'
}
},
tooltip: {
formatter: function() {
return 'Impact: '+ this.y +' points'
}
},
credits: {
enabled: false
},
exporting: {
enabled: false
}
};
jQuery(document).ready(function() {
new Highcharts.Chart({
chart: {
renderTo: 'chart',
defaultSeriesType: 'column',
width: 450
},
title: {
text: 'Comparison of Impact for Male age 23'
},
xAxis: {
categories: [
'Good brain',
'Good humor',
'Good will'
],
},
series: [{
data: [5,2,8]
}],
settings // <-- HERE
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,746,492
| 1,746,493
|
Getting Missing ) argument from below script any suggestions why?
|
<pre><code> <form name="formone" id="optionsform">
<fieldset>
<label><input type="radio" name="group1" id="ac-yes" value="1">Yes</label>
<label><input type="radio" name="group1" id="ac-no" value="0">No</label>
<label><input type="radio" name="group2" id="bt-yes" value="2">Yes</label>
<label><input type="radio" name="group2" id="bt-no" value="0">No</label>
<a href="varible-address">CONTINUE</a>
</fieldset>
</form>
<script>
$(function(){
var urls = new Array();
urls[0]='http://myurl1/';// no + no
urls[1]='http://myurl2/';// yes + no
urls[2]='http://myurl3/';// no + yes
urls[3]='http://myurl4/';// yes + yes
$('input[type=radio]').click(fonction(){
var score = 0;
$('input[type=radio]:checked').each(function(){score+=parseInt($(this).val()});
$('a').attr('href',urls[score]);
}
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,043,371
| 2,043,372
|
Problem with Index of in Substring array
|
<p>ProfilePageList is the string array with each string containing pageID, PageName and PageContent separated by group of characters (#$%). This is a ASP.NET application using C#</p>
<pre><code> foreach (string item in ProfilePageList)
{
string PageContent = ""; string PageName = ""; string PageID = "";
*** > This part is wrong. Help me here ***
PageID = item.Substring(0, item.IndexOf('#$%') + 2);
PageContent = item.Substring(item.IndexOf('#$%') + 1);
PageName = item.Substring(0, item.IndexOf('#$%'));
callsomefunction(PageID , PageName, PageContent);
}
</code></pre>
<p>Input string is <code>Helloo#$%<p>How are you??</p>#$%74396</code></p>
<p>I dont understand how to use this substring. Can someone help me Please!! Thanks a lot in advance..</p>
|
c# asp.net
|
[0, 9]
|
4,046,232
| 4,046,233
|
How to Preserve Formatting in a Multi-Line Text Box
|
<p>I have a website where I create a textbox multi-line at runtime depending on some selections for example, they specify the number of lines and the width, then I create the textbox and put it in a panel on the next page. My issue is that in the textbox they would like to write something like this:</p>
<pre><code> Company Name
123 Test Avenue
New York, NY 10001
</code></pre>
<p>I would like to preserve the formatting, what i mean by this is keeping the next lines as a block, right now if they entered it like that in the textbox it would show like this:</p>
<pre><code>Company Name 123 Test Avenue New York, NY 10001
</code></pre>
<p>Is there a way at all to do this with <code><asp:TextBox/></code> multi-line ?.</p>
|
c# asp.net
|
[0, 9]
|
2,195,170
| 2,195,171
|
jquery color picker hover element
|
<p>Need help with Hover class. </p>
<p>As you can see the code then I have to hover the elements, but unfortunately they do not change color. have any ideas how to make everything working?</p>
<p>I have followed the code:</p>
<pre><code>$('#color_mix_menu_top').ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
$(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
$(colpkr).fadeOut(500);
return false;
},
onChange: function (hsb, hex, rgb) {
$('#menu > ul > li:hover > a, #menu > ul > li > a:hover, #menu > ul > li > div').css('backgroundColor', '#' + hex);
$('#color_mix_menu_top').css('backgroundColor', '#' + hex);
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,848,041
| 1,848,042
|
Android Emulator: Write file to local file system?
|
<p>I am wondering if its possible to get my android application to save a file to a windows file system or is there a simple work around I can adopt?</p>
<p>I am using the android emulator to do tests and I need it to write to the local hard drive so I can do further processing on the file.</p>
<p>I hope this is possible and I appreciate any help.</p>
|
java android
|
[1, 4]
|
1,467,861
| 1,467,862
|
android remote server
|
<p>i'm building an android application which i want all the user of the application share information throw a php script located in my server.
<br>for example: i have a google Map and i want see all my friend's location.
each of my application's users will send his current position the the php script (the server) every numerous of seconds.
<br>i want the php script to send back to each user, the locations of all his friends.
what is the best way of doing it ?<br></p>
<p>i thought of few and will be happy to get help starting them:<br>
1. should i only send requests to the server and in the same request get an answer in return which will include all my friend's position ?<br>
2. should i make it a 2 way communication (using sockets maybe?) and whenever the server gets an update he sends it to all users? (i don't even know how to start doing it..)<br>
3. if i'm using number 2, should i have some kind of event listener which will wait and see if there's a new message from the server ?<br></p>
|
java android
|
[1, 4]
|
4,080,674
| 4,080,675
|
onkeypress textbox issue
|
<p>I have this:</p>
<pre><code><input type="text" ID="txtMy" name="txtMy" onkeypress="initialize();"/>
</code></pre>
<p>And in my .js file I have:</p>
<pre><code>initialize()
{
var x = $("#txtMy").val();
}
</code></pre>
<p>But, if I have '2' in my textbox, and then I enter 4, the value of x is still 2. How to resolve this?</p>
|
javascript jquery
|
[3, 5]
|
3,810,476
| 3,810,477
|
Redirect not working properly
|
<p>Its a very silly problem but somehow it is not working
I have a function to create a file, if it goes through with it i want it to redirect the user to X page.. in this case 1.php.... but somehow is not working :S why?</p>
<pre><code> //Creates File, populates it and redirects the user.
if (createfile($dbFile)) {
header('Location: 1.php');
}
</code></pre>
|
php jquery
|
[2, 5]
|
2,925,958
| 2,925,959
|
How to get the exact path of file stored in internal storage from different tablets?
|
<p>I want to get the <strong>filename</strong> stored in documents folder.</p>
<pre><code>Environment.getExternalStorageDirectory()+"/documents/"+Abc.doc;
</code></pre>
<p>To get the filename, I had hardcoded the path using <code>substring(11, path.length())</code>. It works
fine only for specific tablets, but its not working for some tablets.
How do I get <strong>filename</strong> without hardcoding the path?</p>
|
java android
|
[1, 4]
|
2,531,081
| 2,531,082
|
clear checked radio button value from form
|
<p>I have this piece of code which represents a few radio buttons.</p>
<pre><code><label>Tipologia Pdv: </label>
<input type="radio" name="tipologia_pdv" id="tipologia_pdv" value="Iper" style="width:40px;" /><span > Iper</span>
<input type="radio" name="tipologia_pdv" id="tipologia_pdv"
value="Super" style="width:40px;" /><span > Super</span>
</code></pre>
<p>Then, i have this code which clears the value, but it doesnt work with radio buttons: </p>
<pre><code> $("#tipologia_pdv").val('');
</code></pre>
<p>Now, how would i get the to clear the checked value here?
I assign the checked value with this and it works:</p>
<pre><code>var js_tipologia_pdv = $('input:radio[name=tipologia_pdv]:checked').val();
</code></pre>
|
javascript jquery
|
[3, 5]
|
970,561
| 970,562
|
how can i know if a php file was only called from js on the client side?
|
<p>I have a javascript on my webpage which makes a call to a php file and passes some values to the php file. How can i know for sure that the call to the php file was from the js on my webpage and not directly entering the php url from the browsers address bar?</p>
|
php javascript
|
[2, 3]
|
5,774,965
| 5,774,966
|
Disabling button in javascript not working in IE
|
<p>I have a requirement to disable a button when no value is found for a certain object. This code works in FF and the button is greyed out. It doesn't work in IE however.</p>
<p>Here is my code:</p>
<pre><code>if(c4Obj.getValueByName("Combined_Order",1)=="")
$("#StockPlates_btn").attr('disabled', true)
else
$("#StockPlates_btn").attr('disabled', false);
</code></pre>
<p>Thank you for your time</p>
|
javascript jquery
|
[3, 5]
|
949,344
| 949,345
|
Filter URLs of websites with adult content
|
<p>What I was trying to do was have users type in their favorite sites in a form and submit it onto their profile</p>
<p>What I wanted to ban was pornographic sites, but since there are most likely thousands of those sites out there, what is the best way of banning them?</p>
<p>My first option was using javascript like this one </p>
<pre><code>var bad_sites_arr=new Array("bad.com","adult.com");
</code></pre>
<p>but if I did this, I would have to type every single site and put them in quotes separated by a space and comma. This would be tedious and very time-consuming but also very effective.</p>
<p>My question was, is there another way of banning adult sites?</p>
|
php javascript
|
[2, 3]
|
4,181,401
| 4,181,402
|
How to change the color of few nodes of treeview in asp.net?
|
<p>I need to programmatically change the color of nodes in treeview. Is there any solution with asp.net or jquery?
PS: I am binding the treeview nodes on demand.</p>
<pre><code> private void BindTreeViewControl()
{
try
{
DataTable dt = new DataTable();
dt = GetData();
for (int i = 0; i < dt.Rows.Count; i++)
{
TreeNode root = new TreeNode(dt.Rows[i]["Name"].ToString(), dt.Rows[i]["Name"].ToString());
root.SelectAction = TreeNodeSelectAction.SelectExpand;
root.ShowCheckBox = true;
child.PopulateOnDemand = Convert.ToUInt32(dt.Rows[i]["Count"]) > 0; TreeViewDemo.Nodes.Add(root);
}
}
catch (Exception Ex)
{
throw Ex;
}
}
</code></pre>
|
jquery asp.net
|
[5, 9]
|
1,329,918
| 1,329,919
|
Application object access from regular class in ASP.Net
|
<p>Our teachers (coaches for this project) suggested to store our DAO objects in the Application object, so there's one object of each available for the whole application.</p>
<p>This Application object is easily accessed in the Page codebehind itself, but how do we access it from a plain class that is not extending anything?</p>
|
c# asp.net
|
[0, 9]
|
3,306,179
| 3,306,180
|
Python module installed or not installed?
|
<p>How can I check if my Python module is successfully installed.</p>
<p>I did:</p>
<pre><code>python setup.py install
</code></pre>
<p>inside the folder where my module was downloaded.</p>
<p>Now, I can see that this resulted in a folder inside this location:</p>
<pre><code>/usr/lib/python2.4/site-packages (I can see my module folder is inside here)
</code></pre>
<p>Now I am using PHP to execute a script from this module:</p>
<pre><code>exec("/usr/bin/python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2>&1", $output, $return);
</code></pre>
<p>This runs the script.py file but does not load modules which this script requires.
This script has code like this:</p>
<pre><code>#! /usr/bin/env python
import sys
import os
import getopt
import re
from myModule.ttLib import TTFont // this is line60 as I have removed comments
</code></pre>
<p>I get this error:</p>
<pre><code>Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/MyModule/myModule/script.py", line 60, in ? from myModule.ttLib import TTFont ImportError: No module named myModule.ttLib
</code></pre>
<p>Does this mean there could be some problem with the way my module was installed.
or
How do I check if the module is installed correctly....</p>
<p>I also tried to do this in SSH terminal:</p>
<pre><code>help('modules')
</code></pre>
<p>This listed a load of modules but my module name was missing.</p>
<p>Any help?</p>
<p><em><strong></em></strong> EDIT {Solved} <strong>**</strong>
Reinstalling the module solved it.
Its funny that what I used online SSH tool provided by Mediatemple, it didnt install the module correctly.
Later when I installed using Terminal from my Mac computer, everything worked.</p>
<p>Just thought I will add this for other who might face similar problem.</p>
<p>Thanks</p>
|
php python
|
[2, 7]
|
1,780,389
| 1,780,390
|
Developing using a non-official kit on the Android?
|
<p>I have been doing some research on developing on the Android platform and found that the only way to develop an app using C++ is using the NDK. I also came to know that the NDK has limited support to C/C++, with C++ having even lesser support than C.
Here's the problem. I need to develop using C++ as I'm not very familiar with Java. In fact, not familiar at all. I'm still 18, so I don't have much experience with many programming languages. After doing some more research I have found a non-official NDK, called the NDK-CrystaX that implements more support for C/C++ than the official NDK. Before I start using I have to know if it would be legal to use this custom NDK in an Android app and still be able to sell it on the Android Marketplace. Is it? Or is it not?
Another solution would be if the newer releases of the NDK had full support for C/C++. But I'm not sure of that either, so I'm seeking your generosity again and asking you to share your knowledge on this too.</p>
|
c++ android
|
[6, 4]
|
298,615
| 298,616
|
jQuery.off() is not removing binding
|
<p>For some reason jQuery.off('click') doesn't seem to be working here. When the 'Yes' button is clicked in the model another model just pops up. What am I doing wrong?</p>
<p>code:</p>
<pre><code>$(function(){
//If there are warnings on the page bind alert
if ($('.renewal-warning').length > 0){
(function (){
$('#signRentalContainer').on('click', '.renewal-warning', function(e){
var buttonHandle = this;
//Prevent submission
e.preventDefault();
//Show warning model
$.modal({
content: $('#renewalWarning').html(),
title: "Order Renewal Warning",
buttons: {
'Yes': function(win) { $(buttonHandle).off('click').click(); },
'No': function(win) { win.closeModal(); }
},
maxWidth: 250,
closeButton: false
});
});
})();
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,431,770
| 4,431,771
|
How to make a Jquery form? with persisiting values on panel change
|
<p>I want to make a Jquery form, having form structure like this</p>
<pre><code>panel1{
Name
address
age
years of experience
}
panel2{
graduation deatails.
first year marks
second year marks
third year marks
}
panel3{
some more fileds
}
</code></pre>
<p>then a
NEXTButton previousButton</p>
<p>i want to achinve that at first only first panel should be visible
when i claick the next button the second panel should be visible and 1st and 3rd should be hidden'
and vise versa.
I also want that value should be persist and on next and previos and also the validation should be applicable</p>
<p>could some body suggest me how can i achive this, i am novice for this.</p>
|
javascript jquery
|
[3, 5]
|
4,475,618
| 4,475,619
|
error:Object reference not set to an instance of an object
|
<p>I used 2 gridview and I used this code behind:</p>
<pre><code>protected void SAVE_bt_Click(object sender, EventArgs e)
{
if (Hidden_txt.Text == Convert.ToString(1))
{
for (int i = 0; i < FirstDD_gv.Rows.Count; i++)
{
GridViewRow row = FirstDD_gv.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
if (isChecked)
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = new SqlConnection(Class1.CnnStr);
cmd.CommandText = "insert into table values(@Po_Number,@Line_No,@DelDate,@First_Sec)";
cmd.Connection.Open();
cmd.Parameters.AddWithValue("@Po_Number", PoNumber_lbl.Text);
cmd.Parameters.AddWithValue("@Line_No", FirstDD_gv.Rows[i].Cells[1].Text);
cmd.Parameters.AddWithValue("@DelDate", DeliveryDate_txt.Text);
cmd.Parameters.AddWithValue("@First_Sec", Hidden_txt.Text);
cmd.ExecuteNonQuery();
}
}
}
else
{
for (int i = 0; i < SecondDD_gv.Rows.Count; i++)
{
GridViewRow row = SecondDD_gv.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
if (isChecked)
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = new SqlConnection(Class1.CnnStr);
cmd.CommandText = "insert into table values(@Po_Number,@Line_No,@DelDate,@First_Sec)";
cmd.Connection.Open();
cmd.Parameters.AddWithValue("@Po_Number", PoNumber_lbl.Text);
cmd.Parameters.AddWithValue("@Line_No", SecondDD_gv.Rows[i].Cells[1].Text);
cmd.Parameters.AddWithValue("@DelDate", DeliveryDate_txt.Text);
cmd.Parameters.AddWithValue("@First_Sec", Hidden_txt.Text);
cmd.ExecuteNonQuery();
}
}
}
}
</code></pre>
<p>depends on my hidden_txt.text that just shows one of them
when I used first gridview I don't have any problem but when I used second grid view it shows me this error:</p>
<pre><code>Object reference not set to an instance of an object
</code></pre>
<p>what should I do?</p>
|
c# asp.net
|
[0, 9]
|
1,065,819
| 1,065,820
|
Converting unmanaged C++ code to C#
|
<p>Anyone with pointers to a tool/utility for converting unmanaged c++ to c#?
I have tried the <a href="http://www.pinvoke.net/" rel="nofollow">http://www.pinvoke.net/</a> site but I cant find reference to this API <code>AddUsersToEncryptedFile</code> on this <a href="http://stackoverflow.com/questions/1347275/c-programmatically-adding-efs-certificates-to-encrypted-fileefs">question</a>.</p>
|
c# c++
|
[0, 6]
|
1,990,735
| 1,990,736
|
Programming for non-javascript users
|
<p>To ensure that my site is friendly to non-javascript users, I've built it without using JavaScript, and added it once the site was built.</p>
<p>So now I have a link as following:</p>
<pre><code><a href="http://example.com/panel" id="showPanel">Expand</a>
</code></pre>
<p>But if JavaScript is enabled, I use the following code:</p>
<pre><code>$("#showPanel").attr("href", "#showPanel");
</code></pre>
<p>to make the link point to #showPanel instead of <a href="http://example.com/panel" rel="nofollow">http://example.com/panel</a></p>
<p>While this all works fine, I can't help but wonder if there's a better way to do this?</p>
|
javascript jquery
|
[3, 5]
|
4,714,274
| 4,714,275
|
creating something like pageflakes
|
<p>Does anyone know about a tutorial that lets you to create something like pageflakes.com for your website? In jquery perhaps?</p>
|
javascript jquery
|
[3, 5]
|
2,263,517
| 2,263,518
|
How to refresh and Reload the pages using javascript?
|
<p>I have one requirement.i.e. Have one login form contains username and password,once we entered wrong password, it navigates to another page(Error message page) and I clicked the browser back button for previous page(login page).Now my page is refreshing,but I need page Reloading.Can you please help me how to reload the page.
Thanks.</p>
|
javascript jquery
|
[3, 5]
|
3,746,692
| 3,746,693
|
How can I share data between multiple user controls?
|
<p>I have 3 user controls, each one of which will need to pull data from an XML feed based on various URL parameters and such. Now the data in this XML feed will be identical for all 3 user controls, because they're all sending the same request.</p>
<p>It seems silly to make 3 separate requests for what will be identical data.</p>
<p>My idea is to have a singleton that I'll call which will do one request to the XML service and then present nicely parsed results to the user controls.</p>
<p>i.e.:</p>
<ol>
<li>User control A grabs the singleton.</li>
<li>User control A asks the singleton to make a request...</li>
<li>Singleton makes the request and parses the XML into various properties.</li>
<li>User control C grabs the singleton and pulls its data out.</li>
<li>User control A pulls its data out of the singleton.</li>
<li>User control B grabs the singleton and pulls its data out.</li>
</ol>
<p>Now that I think about it, I'll need to add some sort of blocking to the "make a request" method so that I'm not calling it multiple times concurrently — I'm fairly new to C#, what's the easiest way to do this? Do user controls even run concurrently? Is there a nice overview for this somewhere?</p>
<p>The question is "will a singleton be reinstantiated in between page requests in C#?", but I guess a more general question would be "am I doing a silly thing", "what's the nicest way to do this?" or "is there an easier way to do what I want?".</p>
|
c# asp.net
|
[0, 9]
|
2,442,302
| 2,442,303
|
How can I hide file extensions in PHP?
|
<p>I'm using the jquery plugin <a href="http://abeautifulsite.net/notebook/58" rel="nofollow">jqueryFileTree</a> with the PHP connector (slightly modified to give directories individual classes) to show the contents of a directory. I want to, however, hide all file extensions. Has anyone done something similar? I can think of one or two ways of implementing it but they seem overly-complicated... </p>
<p>Is there a relatively simple way of doing this in PHP?</p>
|
php jquery
|
[2, 5]
|
4,010,446
| 4,010,447
|
find the top left first first visible element in wiew port using jquery
|
<p>I am displaying an ebook in a webpage and would like to be able to create a bookmark inside the document. For this A would like to find the first visible element in the viewport and use it as bookmark. What is the way to achieve this using jquery or plain javascript?</p>
|
javascript jquery
|
[3, 5]
|
5,510,932
| 5,510,933
|
How we can automatically run the test methods in .net?
|
<p>I need to run all the test methods once at a time automatically.
I have separate test methods written in separate files.
Is there any way to run all the test methods at a time automatically.
Please suggest if any.</p>
|
c# asp.net
|
[0, 9]
|
2,169,631
| 2,169,632
|
Meaning of :: Operator in C# and PhP
|
<p>In my work I have come across syntax like global:: (C#) or G:Loading($value) in Php, what do they mean?</p>
|
c# php
|
[0, 2]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.