Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
4,863,711 | 4,863,712 |
Datatable Filter in c#
|
<p>I am loading some data into datatable in a page load event from DB.
Immediately i am setting that datatable into some session.
In some part i am Retreiving it into datatable by taking a new instance of Datatable and performing some filter action to a new datatable instance(But i am not performing any filtering action to datatable which is in Session).</p>
<p>But unfortunately when i check the content of datatable which is in Session, the Filter action has applied for that datatable and some content are missing and i am able to proceed.</p>
<p>Please can any one Suggest how can i get out of this!!!!</p>
<p>Thank in Advance :)</p>
|
c# asp.net
|
[0, 9]
|
1,459,811 | 1,459,812 |
How to test whether an element already has an assigned color?
|
<p>In JavaScript using jQuery during assigning the color to an element having <code>id</code> as <code>'ID'</code> we assign as follows:</p>
<pre><code>$('#ID').css({'background-color':'#FF0000'});
</code></pre>
<p>But how to know whether the element has already been assigned a color?</p>
<p>I need to check whether the element has already been assigned the color red or not. If the color red has been assigned, I need to set some flag in JavaScript.</p>
|
javascript jquery
|
[3, 5]
|
1,154,483 | 1,154,484 |
Jquery, add buttons under elements, and remember which element the button belongs to
|
<p>Please check out my code here</p>
<p><a href="http://jsfiddle.net/bYDPr/20/" rel="nofollow">http://jsfiddle.net/bYDPr/20/</a></p>
<p>So I have some HTML textarea elements</p>
<pre><code><textarea id="area11ba" class="showEditor">1</textarea><br/>
<textarea id="area22ab" class="showEditor">2</textarea><br/>
<textarea id="area33cd" class="showEditor">3</textarea><br/>
<textarea id="area4fg">4</textarea><br/>
<textarea id="area55ed" class="showEditor">5</textarea><br/>
</code></pre>
<p>And I wanna add an "Editor" button under each textarea that has "showEditor" class, then when people click on the Editor button, it should alert the content of that textarea.</p>
<p>Here is my attempt</p>
<pre><code>$("textarea[class*='showEditor']").each(function(index) {
textareaid = $(this).attr('id');
buttonId = "editorButton" + index;
editorButton = '<div class="editorButton"><a id="' + buttonId + '">Editor</a></div>';
$(editorButton).insertAfter(this);
that = this;
$('#' + buttonId).click(function() {
content = $('#'+ textareaid ).val();
alert(content);
});
});
</code></pre>
<p>But unfortunately the alerted value is always 5, which is the last defined element.</p>
<p>How can this be done properly?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,408,581 | 3,408,582 |
why string is not compare using double equal sign
|
<p>Why string is not comparable using <code>==</code>. Why we must use <code>isEqualToString</code> for compare two strings.</p>
<p>Thanks in advance</p>
|
java android
|
[1, 4]
|
5,734,505 | 5,734,506 |
Javascript Array in for loop returns undefined
|
<p>When I loop this array with a for loop it somehow gives me undefined in </p>
<pre><code>updateField(this.value, vehicles[i]+"_brand"
</code></pre>
<p>While </p>
<pre><code>$("#"+vehicles[i]+"_year").change(function(){
</code></pre>
<p>Does get the right values of the array. How can this be and how can I solve this?</p>
<pre><code>var vehicles = new Array();
vehicles[0] = "auto";
vehicles[1] = "truck";
vehicles[2] = "motor";
for(var i = 0;i < vehicles.length;i++){
$("#"+vehicles[i]+"_year").change(function(){
updateField(this.value, vehicles[i]+"_brand", 1, 2, this.parentNode.id), resetBelow(0,'auto'), show('auto_brand');
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,666,694 | 4,666,695 |
How to detect right mouse click + paste using JavaScript?
|
<p>Is there a way to detect a right click followed by paste with JavaScript on IE and Firefox ?</p>
<p>Update:</p>
<p>I decided to use Jquery to do it:</p>
<pre><code>$('#controlId').bind('paste', null, function() {
// code
});
</code></pre>
<p>It's not exactly what I was looking (because it gets fired on 'ctrl + v' as well as in 'right click + paste' but I can work around it.</p>
<p>Tested it on Chrome, Firefox 3, IE 7 and IE 6 and it's working</p>
|
javascript jquery
|
[3, 5]
|
2,885,632 | 2,885,633 |
direct user to another page
|
<p>how do i code it as javascript when user leave the field empty, they will direct the user to another page?</p>
<p>i'm using asp.net..</p>
|
asp.net javascript
|
[9, 3]
|
401,710 | 401,711 |
Hiding radio button list items based on selection of a item in other radiobutton list using jquery
|
<p>In my scenario I have 2 radio button lists(asp.net server controls).
If I select an item in my 1st radio button list then two items in the 2nd radio button list should not be visible.</p>
|
jquery asp.net
|
[5, 9]
|
2,083,812 | 2,083,813 |
Send commands between two computers over the internet
|
<p>I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web interface as it would not be necessary to install software on that computer. For obvious reasons it would require log in details.</p>
<p>So basically the problem is sending encrypted commands from a web interface to my computer at home. What would be the best method to achieve this and what programming languages should I use? I know Java, Python and C quite well, but have very little experience with web applications, such as Javascript and PHP.</p>
<p>I have looked at web chat examples as it is sort of similar concept to what I wish to achieve, except the text can be replaced with commands. Is this a viable solution or are there better alternatives?</p>
<p>Thank you</p>
|
php java python javascript
|
[2, 1, 7, 3]
|
1,530,737 | 1,530,738 |
Banking applications in php
|
<blockquote>
<p>There is an unacknowledged war that goes on every day in the world of
programming. It is a war between the humans and the computer
scientists. It is a war between those who want simple, sloppy,
flexible, human ways to write code and those who want clean, crisp,
clear, correct ways to write code. It is the war between PHP and
C++/Java.<br>
- Adam Bosworth, from a 2004 speech on the primacy of simple, sloppy
systems over rigid, perfect ones.</p>
</blockquote>
<p>I came across the above quote recently.<br>
Somehow I think if it's a war, then to win it there has to be a popular Banking application built in PHP which is also in use. Why Banking, I don't know :-) But I would like to know if there are any Banking applications built with PHP and also in use by real banks?</p>
|
java php c++
|
[1, 2, 6]
|
4,756,644 | 4,756,645 |
jQuery: Radio .change function, strange bug
|
<p>I am trying to get the value of a selected radio after the .change event is triggered. I need to use an external function to do so but I cannot seem to get the correct value.</p>
<p>HTML:</p>
<pre><code><input type="radio" name="myradio" value="1.0"> 1.0
<input type="radio" name="myradio" value="2.0"> 2.0
</code></pre>
<p>jQuery:</p>
<pre><code>$("input[type='radio'][name='myradio']").change(function() {
//SHOWING GOOD VALUE
radio_value = parseFloat($(this).val());
alert(radio_value);
TEST();
}
function TEST(){
//SHOWING WRONG VALUE
radio_value = parseFloat($("input[type='radio'][name='myradio']:checked").val());
alert(radio_value);
}
</code></pre>
<p>For example, if I click the radio 1.0 is checked and I click the radio 2.0, the above jquery code will output 2.0 for the first alert and 1.0 for the second. The TEST() function output the old value, it seems like if the radio event has not happened yet.</p>
<p>I need to find a way to get the good radio value in the TEST() function without transferring any parameter to it.</p>
<p>How can I do such thing?</p>
|
javascript jquery
|
[3, 5]
|
5,483,802 | 5,483,803 |
Event binding for keyboard input or change through javascript
|
<p>I have an input field with id <code>myinput</code> , and have <code>change</code> event bind to this field through,</p>
<pre><code>$("input#myinput").change(function(){
alert("the value is changed");
}
</code></pre>
<p>But the handler is not getting called, if I change the value through javascript</p>
<pre><code>$("input#myinput").val(text);
</code></pre>
<p>But, it works if I enter the input through keyboard.</p>
<p>so, it seems like I am binding to wrong event. What should I do to bind to both keyboard input and JS value update (jQuery <code>val()</code> here).</p>
<p>thanks.</p>
|
javascript jquery
|
[3, 5]
|
3,321,477 | 3,321,478 |
With JQuery, how do I select all elements with no class
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1962247/jquery-get-all-divs-which-do-not-have-class-attribute">jQuery get all divs which do not have class attribute</a> </p>
</blockquote>
<p>I need to select all elements that have no class defined. How do I do that with JQuery?</p>
|
javascript jquery
|
[3, 5]
|
4,961,788 | 4,961,789 |
How to let JavaScript know where I am on the site?
|
<p>I have a single template file which renders pages that look very similar, but behave a bit different. I have a header and a few text boxes, which are filled by the template language, and there is a canvas, whose content actually differentiates the pages. It basically comes down to calling a different JavaScript function based on the page I am on, and I can't really think of an elegant (!) way to do that.</p>
<p>I have a single JavaScript file that uses jQuery's document ready callback to add interactivity to the site, and also to do the drawing in the canvas. For that, I have to call a specific drawing function based on which page I am on, but I don't know it at that point.</p>
<p>This is certainly not impossible, I can in fact think of several different solutions, but don't really like any of these. The script file is not run through a template engine, so I can't employ any server-side logic there. I could parse the URL in the script, but this sounds like a hack to me. I could also set a variable in a script block within the template file, set a hidden field's value or something like that, but I don't think this logic belongs into the template either.</p>
<p>So how is this usually done?</p>
|
javascript jquery
|
[3, 5]
|
956,230 | 956,231 |
Request types on iPhone || Android?
|
<p>Is it possible to send GET, POST, PUT and DELETE requests from iPhone || Android applications to a third party server?</p>
<p>I want to build a web service to reuse on all 3 platforms (3rd being the web app itself).</p>
|
iphone android
|
[8, 4]
|
1,865,670 | 1,865,671 |
add hyperlink to an image(background image)
|
<p>I'm a bit lost as to how to add a hyperlink to an image(background image) that is being called into the page with this HTML below:</p>
<pre><code><div style="background-color: #fff; background: #fff url(/affiliate/uploads/images/subs_bg_4e1a7912cf9a79.22853644.jpg) no-repeat right top" class="bigshadow" id="wrapper"></div>
</code></pre>
<p><strong>i need to add a hyper-link into the background image.</strong></p>
|
javascript jquery
|
[3, 5]
|
3,814,210 | 3,814,211 |
Using global resource in JavaScript
|
<p>I want to use global resource in my javascript code. Normally, when the code is inside the ASP code, I use
<code><%=GetGlobalResourceObject("Resource", "MONTHS_SHORT1") %></code>
and it works. But, when the javascript code is not inside the ASP code, for example in a folder as calendar.js, it does not work. How can I use the global resource in this case? Note: The resource file is inside my App_GlobalResources folder.</p>
|
javascript asp.net
|
[3, 9]
|
2,510,703 | 2,510,704 |
PHP variable not passing correctly to Javascript
|
<p>I am trying to validate input login via javascript by passing PHP variables. I cannot execute it properly for some reason. I'd appreciate your comments. Here's the code:</p>
<p>PHP:</p>
<pre><code>$personal = mysqli_query($connect,"SELECT * FROM basic ORDER BY user_id DESC ");
while($row = mysqli_fetch_array($personal)){
$user = $row['username'];
$user_password = $row['password'];
}
</code></pre>
<p>Javascript / jQuery:</p>
<pre><code>function enter_log() {
var login_username = $("#username_field_log");
var pass_password = $("#pass_field_log");
var button = $("#enter_field_log");
var php = "<?= echo $user; ?>";
if ((login_username.val() == "") || (pass_password.val() == "")) {
$("#user_log_info").fadeIn('slow');
$("#user_log_info").text("Not a proper login input");
login_username.addClass("error");
pass_password.addClass("error");
return false;
}
else if ((login_username.val() != php ) || (pass_password.val() == "")) {
$("#user_log_info").fadeIn('slow');
$("#user_log_info").text("Not a proper login input");
login_username.addClass("error");
pass_password.addClass("error");
return false;
}
}
</code></pre>
<p>So in other words - the code should return false ( and it does so ) when the fields are empty but it doesn't return TRUE when the input is correct ( I mean when the username is correct ) so I assume the PHP variable <code>$user</code> is not passed by correctly to javascript?</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,255,653 | 5,255,654 |
Currency Math in JavaScript
|
<p>Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem:</p>
<p>I need to subtract one number from the other. </p>
<p>The problem is that the numbers have a dollar sign (because its money), therefore jQuery is treating them as strings instead of numbers.</p>
<p>I have created two variables - <code>toalAssets</code> and <code>totalLiabilites</code>. I would like to subtract the latter from the former and place the result into another variable called <code>netWorth</code>.</p>
<p>Perhaps i need to use <code>parseFloat()</code>? </p>
<p>But I'm not sure how - This is all a little over my head!</p>
|
javascript jquery
|
[3, 5]
|
3,062,143 | 3,062,144 |
How to change clickable image in HTML table row dynamically?
|
<p>I have two records on an HTML table. In the last column of each row I have an image which is clickable. Upon click, I am calling a JavaScript function.</p>
<p>What I need know is that if the image can be changed once clicked? The changed image should not be clickable and it should not trigger that javascript function.</p>
<p>Please give me a solution for this in jQuery or JavaScript.</p>
|
javascript jquery
|
[3, 5]
|
5,192,869 | 5,192,870 |
jquery popout of details on mouseover
|
<p>On <a href="http://news.google.com/" rel="nofollow">Google News</a>. there is a carousel with a popout on mouseover on an item. I've also found a video with a tutorial of how to make one: <a href="http://www.youtube.com/watch?v=Iy78nJgRiUM" rel="nofollow">http://www.youtube.com/watch?v=Iy78nJgRiUM</a></p>
<p>Can anyone suggest some other (better?) tutorials out there on how to achieve the same effect?</p>
<p>I'm really looking for this exact behaviour. I'm not really looking to use tooltips, title/alt tags, modal windows, etc.</p>
<p>Edit: Don't you hate it, when you post a question you find somewhere? Ok, I found this also, which will probably help me out. But I am still interested in what others might add. :)</p>
<p><a href="http://impact-products.co.uk/category.asp?cat=Sound" rel="nofollow">http://impact-products.co.uk/category.asp?cat=Sound</a></p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,005,173 | 3,005,174 |
How can I write this jQuery statement shorter?
|
<p>I have this code. This works perfect but I just wanna know if it's possible to write it shorter or not? I looked at jQuery <a href="http://api.jquery.com/hasClass/" rel="nofollow">hasClass()</a> docs but didn't find anything useful.</p>
<pre><code>$(this).hasClass('nw')
?'nw'
:$(this).hasClass('ne')
? 'ne'
: $(this).hasClass('sw')
? 'sw'
: $(this).hasClass('se')
? 'se'
: false ;
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,628,621 | 2,628,622 |
asp Jquery Validators
|
<p>Is it possible to validate textboxes before calling a jquery function and if yes how can this be done? Some validators include RequiredFieldValidator and CustomValidator.</p>
<p>Thanks</p>
|
jquery asp.net
|
[5, 9]
|
2,869,909 | 2,869,910 |
How can I show url of current page inside a text input for user to copy?
|
<p>I'm trying to achieve something similar to what youtube has where when you press share button you can actually see url of current page inside some sort of text input and actually copy it etc. How can this be done with jQuery?</p>
|
javascript jquery
|
[3, 5]
|
1,986,155 | 1,986,156 |
__doPostBack is not working in firefox
|
<p>The __doPostBack is not working in firefox 3 (have not checked 2). Everything is working great in IE 6&7 and it even works in Chrome??</p>
<p>It's a simple asp:LinkButton with an OnClick event</p>
<pre><code><asp:LinkButton ID="DeleteAllPicturesLinkButton" Enabled="False" OnClientClick="javascript:return confirm('Are you sure you want to delete all pictures? \n This action cannot be undone.');" OnClick="DeletePictureLinkButton_Click" CommandName="DeleteAll" CssClass="button" runat="server">
</code></pre>
<p>The javascript confirm is firing so I know the javascript is working, it's specirically the __doPostBack event. There is a lot more going on on the page, just didn't know if it's work it to post the entire page.</p>
<p>I enable the control on the page load event.</p>
<p>Any ideas?</p>
<p><hr /></p>
<p>I hope this is the correct way to do this, but I found the answer. I figured I'd put it up here rather then in a stackoverflow "answer"</p>
<p>Seems it had something to do with nesting ajax toolkit UpdatePanel. When I removed the top level panel it was fixed.</p>
<p>Hope this helps if anyone else has the same problem. I still don't know what specifically was causing the problem, but that was the solution for me.</p>
|
c# asp.net
|
[0, 9]
|
1,378,216 | 1,378,217 |
Call a method when class name not known at compile time
|
<p>I have a number of sub-games, SubGame1, SubGame2 etc. Each is derived from a SubGame class and implements a static String getDescription() function.</p>
<p>I want to access these descriptions, e.g. SubGame1.getDescription(), SubGame2.getDescription() etc.</p>
<p>However I want to use a code loop and not all the subgames will exist.</p>
<p>How can I call getDescription() for a sub game when I only know the game number. Something like:</p>
<pre><code>String description = Class.forName(this.getPackageName()+".SubGame"+subGameNo.getDescription();
</code></pre>
<p>but that returns:
The method getDescription() is undefined for the type Class< capture#5-of ?></p>
<p>Any ideas?</p>
|
java android
|
[1, 4]
|
108,185 | 108,186 |
Compiler error with @override when overriding an interface method on JDK 7u2
|
<p>I know, this sounds like an old question, which has been asked before(<em>*</em>). But it is a little bit different. I installed a clean system with the newest versions of JDK (7u2) and eclipse (and also AndroidSDK). When I import old projects, I get an error "The method methodName(Parameter) of type Class must override a superclass method".</p>
<p>The @override-tag was there (correctly), because the method overrides a method of an INTERFACE of the superclass. somehow compiler thinks that this tag is just for superclass directly. As far as i know @override is not changed in Java 7 and my project was working properly on 6. Is it a possible bug or compability problem or I am missing something?</p>
<p>(<em>*</em>)Similar problem used to happen, when compiling on JDK5, simply because @override was yet implemented in Java 5. Solution was, of course changing compiler compliance level to 6. But what is it with JDK 7 now?</p>
|
java android
|
[1, 4]
|
4,945,494 | 4,945,495 |
Is there any way to get the image of the first page of pdf file in c#?
|
<p>Am looking for a way to get image of the first page in pdf file using c#
Any solution ?? </p>
|
c# asp.net
|
[0, 9]
|
890,819 | 890,820 |
jQuery to fadeIn and fadeOut based upon scroll
|
<p>I'm using the following to change an element's opacity from 0 to 1 based upon the number of pixels they have scrolled and it works perfectly.</p>
<pre><code>$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$("#hook").stop().animate({
opacity: 1
}, 300);
} else {
$("#hook").stop().animate({
opacity: 0
}, 300);
}
});
</code></pre>
<p>What I would like to add is something that says, "when the user has scrolled 500 pixels or more, fade it back out."</p>
|
javascript jquery
|
[3, 5]
|
1,380,323 | 1,380,324 |
Open link on click with jquery after att id append
|
<p>Hi guys i have a situation like this</p>
<pre><code><div class="todos-pedidos" title="/pedidos">See More</div>
</code></pre>
<p>When click this div its expand my UL / LI with this jquery</p>
<pre><code>$('.todos-pedidos').click(function() {
$('#bloco-pedidos-andamento ul li:hidden:lt(2)').slideToggle();
if( ! $('#bloco-pedidos-andamento ul li').is(':hidden') )
$('.todos-pedidos').html("<span class='todos-pedidos2'>See All</span>");
return false;
</code></pre>
<p>when there is no more LI to expand the button change the div text</p>
<p>so i m try for after change the text from see more to see all if the visitor clicks again this go to a url</p>
<p>i tried like this but i think there is some error or conflict, the link dont open</p>
<pre><code>$("span.todos-pedidos2").click(function(event){
event.preventDefault();
var link = $('.todos-pedidos').attr("title");
location.href=link;
});
</code></pre>
<p>thanks for any help</p>
|
javascript jquery
|
[3, 5]
|
1,745,130 | 1,745,131 |
how to grab the Ctl from a linkbutton
|
<p>I have a gridview which is pulling it data from a stored procedure. In the column title, I have used a Linkbutton. I would like to grab the Ctl ID and store it in a variable when it is clicked. I am not sure what is happening, but I get a few strings going through. Below is my code and this is similar to my previous post.</p>
<p>ASP.NET</p>
<pre><code><asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:LinkButton ID="lnkID" runat="server" OnClick="lblClick1"
Text='<%#Eval("ID") %>'>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</code></pre>
<p>C#:</p>
<pre><code> GridViewRow row = gv2.SelectedRow;
string controlId = ((LinkButton)row.FindControl("lnkID")).ID;
lblshow.Text = controlId;
</code></pre>
<p>Can someone help me get up and running. Thanks.</p>
|
c# asp.net
|
[0, 9]
|
1,933,410 | 1,933,411 |
In search of JavaScript Month Picker
|
<p>I'm in search of a JavaScript month selection tool. I'm already using jQuery on the website, so if it were a jQuery plugin, that would fit nicely. I'm open to other options, as well.</p>
<p>Basically, I'm after a simplified version of the <a href="http://docs.jquery.com/UI/Datepicker" rel="nofollow">jQuery UI Date Picker</a>. I don't care about the day of the month, just the month and year. Using the Date Picker control feels like overkill and a kludge. I know I could just use a pair of select boxes, but that feels cluttered, and then I also need a confirmation button.</p>
<p>I'm envisioning a grid of either two rows of six columns, or three rows of four columns, for month selection, and current and future years across the top. (Maybe the ability to list a few years? I can't see anyone ever needing to go more than a year or two ahead, so if I could list the current and next two years, that would be swell)</p>
<p>It's really just a dumbed down version of the DatePicker. Does something like this exist?</p>
|
javascript jquery
|
[3, 5]
|
5,790,156 | 5,790,157 |
How to split an audio file into frames ??? in C#
|
<p>i want to split a wave file(.wav) into frames of 1 second or for a fixed time period. How can i do it using C# or Java.
Can any one help me out for this with some code examples or some related links regarding this.</p>
|
c# java
|
[0, 1]
|
4,379,251 | 4,379,252 |
Playing a sound from a dynamic generated list
|
<p>I am new to C# and ASP.NET and I currently have a page that is dynamically displaying a list of .wav files from a directory using a checkbox list and displaying the date of the file when it was created. However since that is a .wav file I am trying to allow the end user to be able to play it but I am not sure where to start.</p>
<p>Any help will be appreciate it.</p>
<p>Here is the code that I have so far.</p>
<pre><code>if (filesDate > fromDate && filesDate < toDate)
{
Response.Write("<input name=\"" + filePath + "\" type=\"checkbox\" value=\"" + filePath + \"/> <strong>Recording created on: " + filesDate + "</strong><br/>");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,435,226 | 5,435,227 |
Finding CheckBox control in Gridview
|
<p>I have two template fields in my data gridview. One template field is a CheckBox with ID="AttendanceCheckBox" and the other template field is a Label which is bind to the StudentID field in the Student Table.</p>
<p>What is the C# code for finding the CheckBox in the Gridview?
Also I need to add the value (StudentID) in the Template Field Label to a different database table how would I go about achieving this?</p>
<p>Appreciate all the help. Thanks in advance! </p>
|
c# asp.net
|
[0, 9]
|
2,078,352 | 2,078,353 |
jQuery plugin scope issue
|
<p>I'm overlooking something here with scope resolution in this jQuery plugin. Here is a simplified example of what I'm trying to achieve:</p>
<pre><code>(function($) {
$.fn.dashboard = function(options) {
this.onClick = function(e) {
alert("do something");
return false;
};
var createButton(parent) {
//This should call the onClick method defined above when the link is clicked.
var button = $('<a href="#">Reply</a>').click(this.onClick);
parent.append(button);
};
return this.each(function() {
var doc = $('body');
createButton(doc);
});
};
})(jQuery);
</code></pre>
<p>The issue is that onClick never gets called. Definitely seems to be some manner of scope issue.</p>
|
javascript jquery
|
[3, 5]
|
312,786 | 312,787 |
get number of hours between start and end time(HH:MM) 24Hr
|
<p>Hai am new to javascript, I have two textboxes with start and end time How to calculate the number of hours between two times which are in 24 hr format (HH:MM)</p>
|
javascript jquery
|
[3, 5]
|
776,548 | 776,549 |
How to send multiple emails in the background?
|
<p>I am using ASP.NET. I am implementing a forum and I have a comment submission form. When the user submits the comment, the system sends an email to all registered users that a comment has been added to the website. The system is sending multiple emails using a loop and I am connecting with the Gmail server and sending the emails one by one. The problem is that the more registered users you have, the longer the user has to wait until all the emails have been sent and a confirmation message appears on the screen.</p>
<p>Is there a way how to send emails without having the user waiting until all emails have been sent on submission?</p>
|
c# asp.net
|
[0, 9]
|
5,615,029 | 5,615,030 |
How to set white background for checkbox tick in Android?
|
<p>I'm developing Android app for 4.0 version, and all checkboxes have got a black background for tick, but I need white. If I use "background" xml attribute as "white" then all checkbox (with text) is white; I need only white place for tick. </p>
|
java android
|
[1, 4]
|
2,824,166 | 2,824,167 |
ASP.NET - Can I handle the "ASP.NET client-side validation has succeeded" event in javascript?
|
<p>I have a product page with an add to cart button</p>
<p>When the <strong>add to cart</strong> button is clicked, a couple of input fields are validated using ASP.NET validation controls (which use client-side validation to prevent the postback from occurring upon invalid input). </p>
<p>In order to prevent double-clicks from adding multiple items to the cart, I would like to disable the add to cart button after the initial click, but ONLY if validation has succeeded. (It would be rather bad to disable "add to cart" just because they goofed up an input)</p>
<p>Is it possible to handle the "on ASP.NET client-side validation succeeded" event in javascript?</p>
<p>I may just end up rolling my own validation mechanism for this page.</p>
|
javascript asp.net
|
[3, 9]
|
469,428 | 469,429 |
Asp.net 2.0 and c# 3.0?
|
<p>We use asp.net where I work and we are using c# as the language. Will c# 3.0 work with asp.net 2.0? Ive been trying to pick up some books on c#, but not sure which I should be buying, any help would be greatly appreciated!</p>
|
c# asp.net
|
[0, 9]
|
602,322 | 602,323 |
reference a file in a java package with javascript
|
<p>I want to use the following js function to insert an image on a webpage, but I am not referencing the icon file correctly. </p>
<pre><code>function insertWarningIcon(value){
return "<img src='/icons/Warning-icon.png' width='25%' height='25%' />";
}
</code></pre>
<p>The image is contained in a java package 'icons.' The file's path is:</p>
<pre><code>C:\Users\XXXX\Documents\NetBeansProjects\distributedTaskMonitor\src\java\icons\Warning-icon.png
</code></pre>
<p>The html file's path is: </p>
<pre><code>C:\Users\XXXX\Documents\NetBeansProjects\distributedTaskMonitor\web\gridMain.html
</code></pre>
|
java javascript
|
[1, 3]
|
2,063,816 | 2,063,817 |
checking for variable changes within a specified amount of time?
|
<p>I'm trying to check for variable changes within a specified amount of time. For example I got a variable:
int downloadProgress = 0;</p>
<p>and I got some code which downloads a file and the var downloadProgress is being update to 1..2.3....5.6..7. until ..100 (download finishes).</p>
<p>Now I want to have a thread like the following:</p>
<pre><code>Runnable checkNet = new Runnable(){
public void run(){
// check variable changes
}
};
</code></pre>
<p>that checks for changes in the variable downloadProgress within a specified amount of time say 20 seconds. If the variable doesn't change for at least 20 seconds than I want to do something! </p>
<p>How could I utilize a timer to do this within a thread!!</p>
|
java android
|
[1, 4]
|
121,808 | 121,809 |
Very weird behaviour for jQuery getJson() not changing values in a loop
|
<p>OK, this problem is very odd. I am receiving a list of items using getJSON(). For each of the returned items, I perform a lookup using getJSON() again. Upon return of the second lookup, I try to append a variable from the scope of the for-loop to the DOM but the output is the SAME. The weird thing is that when I issue an alert() of the variable right before the second getJSON(), the variables change like it should.</p>
<p>Is this a bug? It seems like getJSON is caching something...</p>
<pre><code>$.getJSON(
"http://someurl",
function(data) {
var items = data.items;
for(i=0; i<items.length; i++) {
var i = items[i];
//when doing an alert of 'i' here, it changes...
$.getJSON(
"http://anotherurl",
function(r) {
$("#feed").append(i.some_property);
//appended item should be different upon each loop
//but ends up appending the same thing every time!!
}
)
}
}
)
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,222,806 | 3,222,807 |
Is there a way of storing Jquery fx in a array, using JavaScript?
|
<p>I was wondering if there was a way of storing Jquery fx(e.g. <code>fadeIn()</code> and <code>fadeOut()</code>) in a JavaScript array?</p>
<p>here's what I'm attempting on jsfiddle : <a href="http://jsfiddle.net/c3FQh/" rel="nofollow">http://jsfiddle.net/c3FQh/</a></p>
<p>Any help would be appreciated greatly, Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,160,649 | 4,160,650 |
setting asp hyperlink values JS
|
<p>i have an asp hyperlink. and i want to set the innerHTML and outerText of this hyperlink in javascript. how can i achieve this?<br>
i have the following code:</p>
<pre><code>var path='c:\folder\file.gif'
var HyperlinkObj = GetElementById('hl');
HyperlinkObj.innerHTML ='<a href='+path+'></a>'; //causes: htmlfile: Unknown runtime error
HyperlinkObj.outerText = 'file.gif'; //how can i get the file name from the path?
</code></pre>
|
javascript asp.net
|
[3, 9]
|
3,429,747 | 3,429,748 |
access is denied IIS server problem
|
<p>i have no problem compiling and viewing my asp.net application using visual studio 2008</p>
<p>but when i try to see it the IIS server (asp.net 4.0...)</p>
<p>i get this message:</p>
<pre><code>Server Error in '/' Application.
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
</code></pre>
<p>i did already run this update:</p>
<pre><code>asp_net_regiis.exe
</code></pre>
<p>is there something else that i should configure?</p>
<p>i've tried to switch the framework to <code>2.0</code> and that failed as well however i got a different message for 2.0:</p>
<pre><code>Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
</code></pre>
<p>any guidance would be most appreciated.</p>
|
c# asp.net
|
[0, 9]
|
4,370,003 | 4,370,004 |
jQuery 1.6 Browser detection
|
<p>With all these api changes in jquery, what is the 'latest' best practice to detect browser name and version in jQuery?</p>
<p>Also, is jquery the recommended language to detect browsers or should I use server-side?</p>
|
javascript jquery
|
[3, 5]
|
1,687,561 | 1,687,562 |
hebrew keyboard changes edittext gravity
|
<p>I have a edittext in which I am supposed to input text in hebrew language which goes RTL so the gravity is set to right but this works fine with english keyboard but for hebrew keyboard the gravity is again changed to left how to solve this problem </p>
<p>I want gravity to be right all the time</p>
<p>I did configchanges entry for keyboard and in onConfigurationChanged function setGravity back to right will that be enough </p>
|
java android
|
[1, 4]
|
1,515,620 | 1,515,621 |
How to append an element into a existing array in javascript/jquery
|
<p>I have an array in javascript</p>
<pre><code>var myArr = {
'textId':'123',
'type':'animal',
'content':'hi dog',
'expires':'27/10/2012'
};
$.each(myArr, function(myArrArrKey, myArrArrValue){
console.log( myArrArrValue );
});
</code></pre>
<p>The above console prints following values</p>
<pre><code>123
app
hi app
27/10/2012
</code></pre>
<p>Now i am want to append an element to the existing array, i am trying to do like the below one</p>
<pre><code>myArrValue.push({'status':'active'});
</code></pre>
<p>The above push throws following error</p>
<pre><code>TypeError: Object #<Object> has no method 'push'
</code></pre>
<p>Kindly help me how to append to that existing array element.<br>
I want to print the array like</p>
<pre><code>123
app
hi app
27/10/2012
active
</code></pre>
|
javascript jquery
|
[3, 5]
|
6,019,779 | 6,019,780 |
Unable to give focus to specific fields with jQuery
|
<p>I'm validating a simple form with jQuery:</p>
<pre><code>$('input:text').blur(function(){
if ($(this).val() == "") {
$("#" + $(this).attr("name") + "_error").show();
$(this).css("border", "2px solid red");
$(this).focus();
return false;
}
});
</code></pre>
<p>The <code>$(this).focus();</code> doesn't keep the focus on the current field - is there a reason this shouldn't be allowed, or am I missing something? </p>
<p><strong>UPDATE</strong></p>
<p>I've been playing around with the code a little; when I try to focus a specific field by selecting it by its id, the focus will never remain on the field that the <code>blur</code> event was called from; for example if I've got 5 fields, with ids <code>field1</code>, <code>field2</code>,...<code>field5</code>, and have the following code:</p>
<pre><code>$('input:text').blur(function(){
if ($(this).val() == "") {
$(this).css("border", "2px solid red");
$("#field4").focus();
return false;
}
});
</code></pre>
<p>if I take the focus away field 1 when it is empty using the tab key, then the focus <em>is</em> switched to <code>#field4</code>, however, if I tab off field 4 when it is empty, the focus does not remain on field 4, but switches to field 5. Is this expected / documented behaviour?</p>
|
javascript jquery
|
[3, 5]
|
803,462 | 803,463 |
render multiplication and division signs in textarea using JavaScript / jQuery
|
<p>I'm developing a very simple math editor, and I want users to be able to input [÷] and [×] by clicking on buttons. I have put these characters directly in the code. They are rendering as errors. When I try to use <strong>&divide;</strong> or <strong>&times;</strong> the textarea shows <em>&divide;</em> or <em>&times;</em> rather than [÷] or [×]. I have CSS to set the font to Arial.</p>
<p>The code receives a param called <code>newSymbol</code> and then appends it:</p>
<pre><code>var textArea = $('#symbolsTextArea');
textArea.val(textArea.val() + newSymbol);
</code></pre>
<p>Any help would be much appreciated.</p>
|
javascript jquery
|
[3, 5]
|
2,215,371 | 2,215,372 |
Script files returning 404 Error
|
<p>I'm using ASP.Net and whenever I create a script file or try to include a script file like jQuery they aren't working. I am doing just a regular localhost server and none of the scripts are working. Upon further examination using firebug I look at whats being referenced in those scripts and it shows html code for a 404 error. I know the scripts and files are there and I can navigate directly to them in the browser but for some reason I can't reference them in my page. </p>
<p>Here is a screenshot:</p>
<p><img src="http://img517.imageshack.us/img517/8058/404z.png" alt="404 Error"></p>
<p><img src="http://img202.imageshack.us/img202/174/4042.png" alt="alt text"></p>
|
asp.net javascript
|
[9, 3]
|
5,234,083 | 5,234,084 |
Show/hide table row based on value of a cell
|
<p>I am using the range slider from JQuery-UI (http://jqueryui.com/slider/#range) which a user uses to pick a price range, and I want to show/hide table rows depending on whether or not they fall inside the range selected by the user.</p>
<p>This is what I have found from other answers: the following code hides the table row that has a cell in column 9 containing the value 10. </p>
<pre><code>$("tr").find("td:nth-child(9):contains(10)").parent().hide();
</code></pre>
<p>What I am trying to do is "hide where the value in the cell is less than 10".</p>
<p>I have tried the following:</p>
<pre><code>$("tr").find("td:nth-child(9):lt(10)").parent().hide();
</code></pre>
<p>But ":lt" is a method that applies to indexes, not values (I think).</p>
<p>Can anyone help me out please?</p>
|
javascript jquery
|
[3, 5]
|
687,731 | 687,732 |
How to read/write file on client side in ASP.NET
|
<p>How to read file form local file system(client side) in asp.net , is there any activeX require to do this or it can be done with out it</p>
|
c# asp.net
|
[0, 9]
|
1,884,176 | 1,884,177 |
PHP/Javascript: Restart Form Button Isn't Working, Code Insde
|
<p>Basically I want a confirmation box to pop up when they click the button asking if they sure they want to restart, if yes, then it destroys session and takes them to the first page. Heres what i got...</p>
<pre><code>echo "<form id=\"form\" name=\"form\" method=\"post\" action=\"nextpage.php\">\n";
echo " <input type=\"button\" name='restart' value='Restart' id='restart'
onclick='restartForm()' />";
</code></pre>
<p>and for the script...</p>
<pre><code><script type=\"text/javascript\">
<!--
function restartForm() {
var answer = confirm('Are you sure you want to start over?');
if (answer) {
form.action=\"firstpage.php\";
session_destroy();
form.submit();
} else
alert ('Restart Cancelled');
}
// --
</script>";
</code></pre>
<p>EDIT: Note that pressing the button brings up the confirm box, but if you click okay nothing happens sometimes. Sometimes if u click cancel it still submits the form (To the original action)</p>
|
php javascript
|
[2, 3]
|
5,073,461 | 5,073,462 |
How do I fade in a div by id if cookie=1?
|
<p>I have a page with few tabs.
I am looking for a way that if you select tab 5 and cookie = 1 then show tab6 otherwise show tab5.</p>
<p>The code for the tabs is:</p>
<pre><code>jQuery(".tabs a").click(function () {
stringref = jQuery(this).attr("href").split('#')[1];
jQuery('.tab_content:not(#' + stringref + ')').hide();
jQuery('.tab_content#' + stringref).fadeIn();
return false;
});
</code></pre>
<p>I want the tab number 5, if clicked and cookie=1 to show tab6.
The code that shows the div5 or Div6 if cookie is 1 or null is:</p>
<pre><code>alreadyClosed = $.cookie(stateCookieName);
if (alreadyClosed != 1) {
$DIV5.show();
$DIV6.hide();
} else {
$DIV5.hide();
$DIV6.show();
}
</code></pre>
<p>How do I add them together? I assume their should be a way to say:</p>
<pre><code>If tab1.click and cookie = 1 then show $div1
else tab1.click and cookie = null then show $div2
</code></pre>
<p>The body looks like:</p>
<pre><code><!-- buttons -->
<ul id="boxes" class="tabs">
<li><a href="#Div5">Div 5</a></li>
<li><a href="#Div6">Div 6</a></li>
</ul>
<!-- content -->
<div class="tab_content" id="Div5">DIV 5</div>
<div class="tab_content" id="Div6">DIV 6</div>
</code></pre>
<p>I hope you guys can help me.
Thanks alot & Regards,
rallyboy.</p>
|
javascript jquery
|
[3, 5]
|
1,064,191 | 1,064,192 |
iphone apns sending push notification in different languages with voice
|
<p>i have studied and implemented Ray wenderlich's awesome tutorials on apns, and i am using this php script on server side</p>
<p><a href="https://github.com/sebastianborggrewe/PHP-Apple-Push-Notification-Server" rel="nofollow">https://github.com/sebastianborggrewe/PHP-Apple-Push-Notification-Server</a></p>
<p>every thing is going well, but i just want to know that how can i send push notification in a language other than english, like arabic, urdu, hindi or french...???(i am sending notifications from php server using a web form) this is first part of question, the other part is that can i send a voice message with push notification, i know that there is a property for sound in apns but dont know its max. length (max length of push notification is 256 bytes). plz. guide me thanx and Regards Saad. </p>
|
php iphone
|
[2, 8]
|
3,082,857 | 3,082,858 |
opening new window in ie7 opens same target as base window but shows proper url in firefox
|
<p>i have a simple little form</p>
<pre><code><form id="loginform"> <input id="myinput" type="text" /> <input name="submit" value="go" type="submit" /></form>
</code></pre>
<p>in a very not secure way i want it to go to different urls depending on the input value.</p>
<p>here is my simple little jquery script that i am sure could be written more succinctly. (feel free to help)</p>
<pre><code>$(document).ready(function() {
jQuery.noConflict();
var apple = 'http://www.apple.com';
var microsoft = 'http://www.microsoft.com';
jQuery('#loginform').submit(function() {
var pass = jQuery('#myinput').val();
if (pass=='apple') {
var currentloc=apple;
} else if (pass=='microsoft') {
var currentloc=microsoft;
}
else {
var currentloc ='http://www.mysite.com/sorry';
}
window.open(currentloc, 'formpopup', 'width=800,height=600,resizeable=1,scrollbars=1');
});
});
</code></pre>
<p>this works when i run it on ffcurrent macintosh, but not when i run it in ie7. then the popup window is the same as the window we are coming from.</p>
|
javascript jquery
|
[3, 5]
|
1,420,392 | 1,420,393 |
How to detect is argument jQuery object
|
<p>I want to create function that can be used either with Id or by passing jQuery object.</p>
<pre><code>var $myVar = $('#myId');
myFunc($myVar);
myFunc('myId');
function myFunc(value)
{
// check if value is jQuery or string
}
</code></pre>
<p>How can I detect what kind of argument was passed to the function?</p>
<p><strong>Note!</strong> <a href="http://stackoverflow.com/questions/6283255/detect-if-an-argument-is-a-jquery-selector">This</a> question is not same. I don't want to pass selector string like <code>#id.myClass</code>. I want to pass the jQuery object like in the example.</p>
|
javascript jquery
|
[3, 5]
|
2,763,481 | 2,763,482 |
Serializing form in jquery and passing it into php
|
<p>I have been trying for the last couple of days to serialize a form in jquery and pass it to php. For some reason it just doesn't work... Question, What steps do you take to serialize a form in Jquery... I get the id of the form pass it into $('#fomrID').serialize()...</p>
<p>And it still doesn't work. When I debugg with firebug All I get is an empty string... Do you use the name or the Id of the form. Do you use e.disableDefalut or whatever that is? I can't figure out why I can't serialize my form please help</p>
<pre><code> $('#profilepicbutton').change(function(){
alert("Boy I hate PHP");
var formElement = $('#profilepicinput').attr('value');
dataString = $("#registerpt3").serialize();
$.ajax({
type: "POST",
url: "register3.php",
data: dataString, //"profilePic="+formElement,
success: function(data){
alert( "Data Saved: " + data );
$.ajax({
type: "POST",
url: "retrievePic.php",
data: "",
success: function(data){
alert(data);
var image = new Image();
$(image).load(function(){
console.log("we have uploaded this image");
}).attr('src', 'images/');
alert("");
},
error: function(msg){
alert("");
}
});
},
error:function(msq){
alert("" + msg);
}
}
);
});
<form id="registerpt3" name="registerpt3" enctype="multipart/form-data" action="register3.php" onSubmit="" method="post">
<input name="profilepicinput" type="file" id="profilepicbutton" />
</form>
</code></pre>
|
php jquery
|
[2, 5]
|
2,686,191 | 2,686,192 |
ContentFlow: load AddOn on creation?
|
<p>I'm using ContentFlow (<a href="http://www.jacksasylum.eu/ContentFlow/index.php" rel="nofollow">http://www.jacksasylum.eu/ContentFlow/index.php</a>) to create an image carousel on my page. The images are loaded via a jQuery AJAX-call. This works fine. The ContentFlow is included with this code:</p>
<pre><code><script language="JavaScript" type="text/javascript" src="contentflow.js" ></script>
</code></pre>
<p>Now I want to apply the default 'white' addOn upon creation of the ContentFlow. The CF is created in my document.ready()-codeblock. According to the documentation this should be done like (I believe):</p>
<pre><code>$(document).ready(function () {
...
var ajax_cf = new ContentFlow('ajax_cf', {useAddOns : 'white' });
});
</code></pre>
<p>The ContentFlow is created just fine, the AddOn/theme however, is not applied. When using a non-AJAX approach the theme is applied correctly, so I know for sure the theme works, has no syntax errors, etc.</p>
<p>Any clues?</p>
|
javascript jquery
|
[3, 5]
|
394,575 | 394,576 |
jQuery: Get the first cell in the first row that has a specific class?
|
<p>I was using this:</p>
<pre><code>$('#' + tableID + "tr:first td:first")
</code></pre>
<p>To get my first cell, but there is potential the first cell isn't what I want. The cell I'm looking for is the first cell in the first row that has the class 'canEdit'. Any idea how to go about doing that? </p>
|
javascript jquery
|
[3, 5]
|
3,735,895 | 3,735,896 |
C# ASP.NET Foreign Characters(ü) Ampersand Confusion
|
<p>I am developing a simple website and I need to use Turkish characters (ç,ş,ğ,ı,ü) in username and other fields. When executing the following statement,</p>
<pre><code>Response.Redirect("View2.aspx?ApplicantName=" + applicantname);
</code></pre>
<p>it cannot get applicantname when applicant name contains "ü". I suspect it is because "ü" has ampersand (&) in its representation which is <code>&#252;</code>.</p>
<p>So what do I need to do to fix it ?</p>
|
c# asp.net
|
[0, 9]
|
1,059,422 | 1,059,423 |
Second occurrence of checkbox
|
<p>How to get the second occurrence of checkbox ?
Here is what I have tried:</p>
<pre><code><div id="form">
<label for="first">First</label>
<input type="checkbox" name="first" value="1" >
<br />
<label for="second">Second</label>
<input type="checkbox" name="second" value="2" >
<br />
</div>
$('#form').find('input[type=checkbox]').eq(1)
</code></pre>
<p>But it doesn't work for me.</p>
|
javascript jquery
|
[3, 5]
|
1,197,498 | 1,197,499 |
Creating a desginer in WebApplication
|
<p>I am planning to develop a small web application, which enable users to create small application according to their needs. The layout of the web page should be like visual-studio, where:</p>
<ul>
<li>The left pane contains all the
controls(I only provide few basic
controls like txt box, lbl etc)</li>
<li>The right pane contains the
properties of currently selected
control (again only few basic properties like color, font etc)</li>
<li>And the canvas lies in the middle of
page, where user drag and drop
controls and set their properties</li>
</ul>
<p>I am beginner, please guide me where to start and what resources to study. According to my knowledge i need to do some scripting (java script, JQuer, GWT). If that's right then what scripting languages should i use with ASP.net and C# </p>
<h1>Edit:</h1>
<p>I have experience of web application development but i never used scripting, <strong>so i only need guidance regarding scripting</strong></p>
|
javascript asp.net
|
[3, 9]
|
3,311,477 | 3,311,478 |
Is this a bad practice for droppable?
|
<p>Whenever a user presses a div button I want to register a droppable. I'm setting a the closure<br>
<code>add.droppable({})</code> to the <code>var toDrop</code> and then invoking methods on <code>toDrop</code> as below, is this a bad practice ?</p>
<p>For example instead of <code>toDrop.addClass("newColors");</code> should I be using something like </p>
<pre><code>this.addClass("newColors")
</code></pre>
<p>Here is the complete snippet : </p>
<pre><code>$("#myDiv").on('click' , '.colors' , function() {
var add = $(this).parent();
var toDrop = add.droppable({
drop: function(event, ui) {
toDrop.addClass("newColors");
toDrop.attr("portletName", parameter);
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,025,028 | 1,025,029 |
Getting error on 2nd line in code below..What could be wrong?
|
<pre><code>for (I = 0; I < ds.Tables[0].Rows.Count; I++)
{
if (Convert.ToBoolean(ds.Tables[0].Rows[I]["IsDefault"].ToString()) == true && Convert.ToBoolean(ds.Tables[0].Rows[I]["IsBill"].ToString()) == true)
.
.
.
.
</code></pre>
<p>Error: System.FormatException: String was not recognized as a valid Boolean.</p>
<p>Is default and IsBill are boolean values only</p>
|
c# asp.net
|
[0, 9]
|
4,063,868 | 4,063,869 |
C#, ASP.NET 3.5 - Load code at run-time
|
<p>A friend of mine is building a Content Management System in PHP.</p>
<p>PHP is a scripting language where code is evaluated at run-time, and therefore it is fairly simple to add code.. at run-time (think: a forum, a contact form, etc.)</p>
<p>Doing the same in ASP.NET (which is compiled).. not as simple.</p>
<p>Have you guys got any thoughts on how you would load code dynamically and use it within a live web application?</p>
|
c# asp.net
|
[0, 9]
|
2,892,447 | 2,892,448 |
How to get <td> value in textbox
|
<p>I've done some code in html and in JavaScript ... My query is when I click on <code><td></code>, whatever the value associated with it, has to be displayed in the corresponding text box ...
In front of <code><td></code> I've taken the textbox ... for an example I've taken 3 <code><td></code> and 3 textboxes </p>
<pre><code> <script type="text/javascript">
function click3(x) {
x = document.getElementById("name").innerHTML
var a = document.getElementById("txt");
a.value = x;
}
function click1(y) {
y = document.getElementById("addr").innerHTML
var b = document.getElementById("txt1");
b.value = y;
}
function click2(z) {
z = document.getElementById("email").innerHTML
var c = document.getElementById("txt2");
c.value = z;
}
</script>
</code></pre>
<p>this is my JavaScript code , I know this is not an adequate way to deal such problem, since its giving static way to deal with this problem
does anyone have a better solution for this problem ??
In JavaScript/jQuery </p>
|
javascript jquery
|
[3, 5]
|
51,258 | 51,259 |
How to do autoplay(image) in jquery?
|
<p>I have 3 images. I want to show one by one through auto play with various time delay(first one 3 seconds,second one 5 seconds,third one 7 seconds). Finally i want to loop it.</p>
<p>I have no idea to do it. Please share ideas with me for it.</p>
|
javascript jquery
|
[3, 5]
|
2,100,542 | 2,100,543 |
Why aren't my Strings showing as equal when they are?
|
<p>I am currently working in Eclipse making a Android App. At the moment I have two Strings and I need to check if they are equal or not, the problem is the Strings are equal but it is showing them not to be which is really frustrating me. </p>
<pre><code> if (newSource.equals(source)) {
Log.d("Equal:", "Strings are equal");
}
else {
Log.d("Not Equal: ", "Strings aren't equal");
}
</code></pre>
<p>When I run this it just prints in the log cat that the strings aren't equal. I have printed both strings in the log cat to check that they are 100% equal which they are. I was just wondering if any one could see an error in my code?
Thanks</p>
|
java android
|
[1, 4]
|
753,018 | 753,019 |
How to pass ID to a JavaScript function
|
<p>In HTML, I have:</p>
<pre><code><td>
<span id="change_naco"></span>
<span id="naco">Food</span>
</td>
<td>
<span id="change_naco"></span>
<span id="naco">apples</span>
</td>
</code></pre>
<p>The rows come from the MySQL query. I need to load them in the function:</p>
<pre><code><script type="text/javascript">
EditInPlace.defaults['save_url'] = 'php/save.php?id=150';
$('naco').editInPlace({
form_type: 'select',
select_options: {
'1': 'food',
'2': 'apples',
'3': 'oranges',
'4': 'beer'
},
external_control: 'change_naco'
});
</script>
</code></pre>
<p>I know that I must call my ID's differently, so I can do that by adding a number via PHP, for example, <code>change_naco1, change_naco2, change_naco3</code>, and <code>naco1, naco2, naco3</code>, but do I pass those ID names to the function?</p>
<p>It's for edit in place (dropdown menu). It's working fine for one ID, but when I load more lines from the query, it works only for the first one.</p>
|
javascript jquery
|
[3, 5]
|
3,012,040 | 3,012,041 |
how to get the javascript function value in textbox?
|
<p>i am write the javascript function like this, my problem is i can pass the values (quantity and price ) retrive amount, print the amount in lable and textbox(same values), but label is working and textbox value after select another operation first value will come , what is the problem in the code or any modification (i am using OnChange event) and some time working with IE browser (but add the master page doesnot work any browser)</p>
<pre><code>function Total(Quantity,Price,Amt)
{
var Quan=document.getElementById(Quantity).value;
var Pric=document.getElementById(Price).value;
var tt=document.getElementById('lblTotal').innerHTML;
//var h=document.getElementById('h1').value;
//tt=h;
if(tt=='')
{
tt=0;
}
if(Quan=='')
{
}
else
{
var cc1=document.getElementById(Amt).value;
if(cc1!='')
{
tt=parseFloat(tt)-parseFloat(cc1);
}
document.getElementById(Amt).value=(parseFloat(Quan)*parseFloat(Pric)).toFixed(2);
var cc=document.getElementById(Amt).value;
//document.getElementById(Amt).value=cc.toFixed(2);
document.getElementById('lblTotal').innerHTML = (parseFloat(tt)+parseFloat(cc)).toFixed(2);
document.getElementById('h1').value=document.getElementById('lblTotal').innerHTML;
document.getElementById("<%= TextBox1.ClientID %>").innerText =document.getElementById('lblTotal').innerHTML;
}
</code></pre>
|
javascript asp.net
|
[3, 9]
|
411,160 | 411,161 |
How can I parse this home-made string-based data format?
|
<p>I need to iterate through a dataset of IDs and labels. I got some part of the code right, but I need some assistance. </p>
<pre><code>// 1. String
var string = '1:answer1,2:answer2,3:answer3,4:answer4,5:answer5,'
// 2. Split to array
var string = string.split(",");
// 3. EACH
$.each(string, function(key, val) {
var answer = answer.split(":");
$.each(answer, function(key1, val1) {
// output textfield with id of key1 and value of val1
});
});
</code></pre>
<p>I can go through the first set of data, that is comma separated, but not the next (:). How do I do that?</p>
|
javascript jquery
|
[3, 5]
|
4,728,518 | 4,728,519 |
How to do something everytime a certain element is in view using jQuery?
|
<p>Right now every time the user reaches the bottom of my page I update the url hash using this code:</p>
<pre><code>var new_page_value = 1;
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()) {
new_page_value += 1;
window.location.hash = 'page-' + new_page_value;
}
});
</code></pre>
<p>How can I do the same when the user scrolls past any of the divs with the class "page" in the code below? For example if the user scrolls into view the 1st one the hash should be updated to #page-1 but as soon as they scroll into view the 2nd one the hash should be updated to #page-2 and so on. And if they scroll back to the first the hash should once again be updated to #page-1. Basically the hash should update based on whatever div is in view.</p>
<pre><code><div class="page" data-page-num="1"></div>
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<div class="page" data-page-num="2"></div>
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<div class="page" data-page-num="3"></div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,927,636 | 2,927,637 |
dynamic tag count on keyup
|
<p>I have a div that contains many spans and each of those spans contains a single href.</p>
<p>Basically it's a tag cloud. I have a textbox with a keyup event that filters the tag cloud div (It actually just hides the tags if not in filter condition).</p>
<p>Is there a way to get a count of the tags shown as the keyup event occurs?</p>
<p>Thanks,
rodchar</p>
|
javascript jquery
|
[3, 5]
|
4,025,867 | 4,025,868 |
How to run through each checked checkbox with a classname using JavaScript without jQuery
|
<p>Is there an immediate equivalent in javascript for the below jquery code?</p>
<pre><code>$('.checkbox').each(function() {
if ($(this).is(':checked')) {
//logic here
}
});
</code></pre>
<p>I'm trying to run through all the checkboxes on a page with <code>class = 'checkbox'</code> - the client doesn't want to use jQuery, so I need an alternative for the above.</p>
<p>I'm hoping I can avoid writing a long function from scratch to do this and simply use something built-in to JavaScript, but it's looking like it's not possible.</p>
|
javascript jquery
|
[3, 5]
|
4,525,439 | 4,525,440 |
jQuery toggleClass animation issue
|
<p>I have this page:</p>
<p><a href="http://beta.amitai-clinic.com/" rel="nofollow">http://beta.amitai-clinic.com/</a></p>
<p>If you hover the top left logo, it should 'fade' the same logo with some text underneath it.</p>
<p>Problem is, the logo part is being faded in naturally, but the text beneath it looks like it's being placed in all together, and not faded in 'naturally'.</p>
<p>Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
1,663,400 | 1,663,401 |
Is it possible to have the menu link color change on the table hover for an asp.net menu control?
|
<p>I'm using an ASP.net menu and when i hover inside my menu item's table, i change the background color on the table column, but unless i hover over the link text itself, the link text color will not change.</p>
<p>Is it possible to have the link text color changed on the table hover?</p>
<p>Example below shows what happens.</p>
<p><img src="http://i.stack.imgur.com/r5AoI.jpg" alt="example of issue"></p>
<p>Excuse the ugly CSS:</p>
<pre><code>.TopStaticSelectedStyle
{
cursor: pointer;
font-size: 11px;
font-family: Verdana;
}
.TopStaticMenuStyle a,
.TopStaticMenuStyle a:visited,
.TopStaticMenuStyle a:active
{
color: #ffffff;
text-decoration: none;
font-weight: bold;
font-family: Verdana;
}
.TopStaticMenuStyle a:hover
{
color: #000000;
text-decoration: none;
font-size: 11px;
font-weight: bold;
font-family: Verdana;
}
.TopStaticMenuItemStyle td
{
padding: 0px 12px 0px 12px;
text-align: center;
background-color: #6c85b0;
height: 18px;
border-top: solid 1px #012754;
border-bottom: solid 1px #012754;
border-left: solid 1px #012754;
border-collapse:collapse;
}
.TopStaticHoverStyle
{
font-weight: normal;
font-family: Verdana;
}
.TopStaticHoverStyle td
{
padding: 0px 12px 0px 12px;
text-align: center;
background-color: #ffffff;
height: 18px;
border-top: solid 1px #012754;
border-bottom: solid 1px #012754;
border-left: solid 1px #012754;
border-collapse:collapse;
color: #000000;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,636,411 | 5,636,412 |
JQUERY/ASP.NET : Accordion and SQL
|
<p>I have a Jquery UI Accordion.</p>
<p>The first slide, the user selects a Make and Model, and clicks the "Continue" button".</p>
<p>Once the user clicks the continue button,the second slide comes up and SHOULD display a price. The price is calculated by simply preforming a select command WHERE Model=SelectedModel and Make=SelectedMake.</p>
<p>The contents of the second slide:</p>
<p>`"
SelectCommand="SELECT PRICE FROM [Devices] WHERE (([Condition] = @Condition) AND ([Make] = @Make) AND ([Model] = @Model))">
</p>
<pre><code> $<%# Eval("Price")%></h6>`$
</code></pre>
<p>The problem is, the eval is returning nothing.</p>
|
jquery asp.net
|
[5, 9]
|
4,995,938 | 4,995,939 |
Execute a javascript function only if session["x"]="ok"; if it is not, not execute!
|
<p>Well i have 2 aspx
page1 you are going to have amm two buttons or it dontmind but the goal is...</p>
<p>when user press button1 in page1.aspx, session["x"] will be equals to "ok"
if users press button2 in page1.aspx, session["x"] will be eauls to null;</p>
<p>so after press any button user will be redirected to page2.aspx.</p>
<p>i want to execute a javascript function if session is equals to "ok" and not to do it
if session is null, someidea? when page2.aspx is open javascript function will be done automatically, if it is null, javascript function will not be nothing or it will not be executed. some idea? thanks guys!</p>
<p>it worked so...</p>
<p>the real code was it..</p>
<pre><code><% if (Session[@"codigodiagrama"] != null){%>
<script type="text/javascript">
window.onload= function () {
alert('with code');
}
</script>
<% } %>
<% if (Session[@"codigodiagrama"] == null){%>
<script type="text/javascript">
window.onload= function () {
alert('null');
}
</script>
<% } %>
</code></pre>
<p>now i want to pass the session["codigodiagrama"] to the function
if it has code to pass the String (codigodiagrama)</p>
<p>i refer how to pass this session to this windows.onload =function(pass code here)</p>
|
javascript asp.net
|
[3, 9]
|
5,678,200 | 5,678,201 |
Javascript changing source of an image
|
<p>I have some javascript which runs a timer that animates something on the website.</p>
<p>It all works perfectly but I want to get an image to change when the animation is run, It uses jquery: </p>
<pre><code>if(options.auto && dir=="next" && !clicked)
{
timeout = setTimeout(function(){
if (document.images['bullet1'].src == "img/bulletwhite.png")
{
document.images['bullet1'].src = "img/bullet.png";
document.images['bullet2'].src = "img/bulletwhite.png";
}
animate("next",false);
},diff*options.speed+options.pause);
}
</code></pre>
<p>options.auto means that its automatically cycling, dir is the direction of the motion and clicked is whether or not the user clicked it.</p>
<p>Is there something wrong with my syntax here? I ran firebug with it, and it doesn't throw any errors, it simply won't work. Any advice would help!</p>
<p>I should mention that the src of bullet1 starts at bulletwhite.png and then I was hoping for it to change to bullet.png and have bullet2 change to bulletwhite.png.</p>
|
javascript jquery
|
[3, 5]
|
1,505,972 | 1,505,973 |
Why does my Android program crash when I access the Orientation sensor (HTC Desire)?
|
<p>So I am playing around with the Android api, and am trying to figure out how to get the heading the phone is pointing towards.</p>
<p>I have the following code:</p>
<pre><code>private SensorManager mSensorManager;
private Sensor mAcceller;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
checkNotNull(mSensorManager);
try {
mAcceller = mSensorManager.getSensorList(3).get(0);
} catch (Exception e) {
showToast(e.getMessage(), Toast.LENGTH_LONG);
}
}
</code></pre>
<p>But when I try to run it on my phone I just get a message that the program has crashed. When I run it in the emulator it tells me that there are no sensors (thats to be expect, but it means I can't test the code).</p>
<p>Does anybody know how to work around this issue? I know the error happens in the try statement because if I comment it out, the program runs.</p>
<p><em>Edit</em>: It turns out that I am an idiot, the crash happened when I null refered somewhere else in my code, as a response to getting a notification that the sensor had been turned on.</p>
<p>Dave if you upgrade your comment to an answer, I will mark that as accepted (since I found the problem as soon as I figured out how the debugger worked).</p>
|
java android
|
[1, 4]
|
3,943,878 | 3,943,879 |
jQuery objects are internally converted to JavaScript arrays, how do I copy that behavior?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7261670/what-makes-a-jquery-object-show-up-as-an-array-in-chromes-developer-tools">What makes a jQuery object show up as an array in Chrome's Developer Tools?</a> </p>
</blockquote>
<p>I am writing a very small, jQuery-like, DOM wrapper in JavaScript, containing only the (few) functions I need most. I have noticed that, when I log a jQuery object to the console of my browser, the object is actually an array. For example: [Document]. I would like to copy that behavior. Can anyone explain me how jQuery does this internally, or even better point me to some relevant lines in the jQuery source code?
I know that objects and arrays in JavaScript have much in common, but jQuery seems to return true arrays for the $ selections, not objects.
I have already read the following post on stackoverflow but it doesn't seem to answer my question:</p>
<p><a href="http://stackoverflow.com/questions/9233814/are-javascript-arrays-actually-implemented-as-arrays">Are javascript Arrays actually implemented as arrays?</a></p>
|
javascript jquery
|
[3, 5]
|
4,569,022 | 4,569,023 |
View.getId and R.id.viewLabel return different values
|
<p>Let's say I have a method like this into my activity, and set it as <code>onClick</code> field of different buttons into xml:</p>
<pre><code>public void onButtonPressedFromView(View button) {
switch(button.getId()) {
case (R.id.button1) :
//do something
break;
case (R.id.button2) :
//do something different
break;
default :
//default action
break;
}
}
</code></pre>
<p>It comes out that, if I press for instance button1, the id obtained with <code>button.getId()</code> is always bigger of 1 than the id obtained with <code>R.id.button1</code>. It's quite easy to solve, I just changed my code into</p>
<p><code>switch(button.getId() - 1)</code></p>
<p>but I don't like it, and would like to understand the difference between these two ways of obtaining the id of a view.</p>
|
java android
|
[1, 4]
|
5,854,506 | 5,854,507 |
Javascript: fake a touchdown event?
|
<p>If I have a x,y coordinate onscreen is there a way to 'fake' a touchdown event?</p>
|
javascript iphone
|
[3, 8]
|
4,921,758 | 4,921,759 |
How to get full URL on the address bar using PHP
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/967649/get-entire-url-including-query-string-and-anchor">Get entire URL, including query string and anchor</a> </p>
</blockquote>
<p>I have my url like <em>www.domain.com/#!/username</em> (just like in twitter).</p>
<p>How can I retrieve the full URL (the whole string above) including the substring after '#!' in the address using PHP or Javascript??</p>
|
php javascript
|
[2, 3]
|
165,786 | 165,787 |
MasterPage issues with anchor tags and fancyBox
|
<p>I've got some ASP:Hyperlink controls on the master page for a set of global links. I'm using the 'permissions' property so I'm hoping to keep these.</p>
<p>If I setup the control like this:</p>
<pre><code><asp:HyperLink ID="inlineMileageCalc" runat="server" NavigateUrl="~/#mileageCalc">Mileage Calculator</asp:HyperLink>
</code></pre>
<p>Everything works fine when I'm on the default.aspx page in the root. However, if I go down one more level like <a href="http://www.xxxxx.com/nextlevel/default.aspx" rel="nofollow">http://www.xxxxx.com/nextlevel/default.aspx</a> the fancyBox will not render, just throws a jQuery error.</p>
<p>Is there a way to do this to make the fancyBox show no matter what level I'm on?</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
4,433,074 | 4,433,075 |
jquery removeClass()
|
<p>Is it possible to remove all classes of an element that are not equal to a certain string, </p>
<p>for example, if I have the following HTML</p>
<pre>
<code>
<a href="" class="status pending"></a>
<a href="" class="status successful"></a>
<a href="" class="status unsuccessful"></a>
</code>
</pre>
<p>Could I remove all the classes that are not equal to status?</p>
|
javascript jquery
|
[3, 5]
|
2,168,082 | 2,168,083 |
Detect scroll on bottom on iphone
|
<p>I want to detect if i'm at the bottom of a page. This works fine on any browser - but not on iPhone.</p>
<pre><code>if ($(window).scrollTop() == ($(document).height() - $(window).height())){
alert('on bottom');
}
</code></pre>
<p>What i'm doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
3,619,211 | 3,619,212 |
Javascript and Required field validator
|
<p>I have a RequiredFieldValidator on a TextBox. This works fine when nothing is enterd in the TextBox. Now, one more validation I do is when the user enters some junk data, I throw an error-message saying "invalid entry". This is on the Label.</p>
<p>Now the scenario is after the error-message is thrown, if the user empties the textbox and clicks on the button, the RequiredFieldValidator works but the error-message on the label still remains as it is. I would like to hide/remove it once the user empties the textbox.</p>
<p>For this I used a JavaScript function but with this the RequiredFieldValidator does not work. Here's my code: </p>
<pre><code><asp:TextBox ID="txtemp" runat="server"></asp:TextBox>
<asp:Button ID="btnstatus" runat="server" ValidationGroup="valgrp1" OnClientClick="Validate()"
CausesValidation="true" onclick="btnstatus_Click"
Text="Fetch status message" BackColor="#ccebff" />
&nbsp;
<asp:RequiredFieldValidator ID="Reqfield1" ControlToValidate="txtportalid" ValidationGroup="valgrp1" ErrorMessage="wrong entry" runat="server" />
</div>
<div>
<asp:Label ID="lblerrormsg" runat="server" Font-Bold="true" Visible="false" ForeColor="#FF3300">
</asp:Label>
</div>
</code></pre>
<p>JavaScript:</p>
<pre><code>function Validate()
{
var txt1 = document.getElementById("<%= Txtemp.ClientID %>");
var val1 = txt1.value.replace(/\s/g, "");
if (val1=="")
{
document.getElementById("<%= lblerrormsg.ClientID%>").style.display = 'none';
}
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,508,147 | 2,508,148 |
hide option select value based on option value selected on first options
|
<p>I have two select option field.</p>
<pre><code><div style="float:left; width:7%">
<label>Type</label>
<select name="ostatus" id="ostatus" class="input-small">
<option value="Actual">Actual</option>
<option value="Ghost">Ghost</option>
</select>
<div style="float:left; width:7%">
<label>Upgrade</label>
<select name="oupg" id="oupg" class="input-small">
<option value="Exp" >Exp</option>
<option value="Post" >Post</option>
<option value="Upgrade" >Upg</option>
<option value="Retail" >Retail</option>
<option value="Prepaid" >Prepaid</option>
</select>
</code></pre>
<p>If on the Type select, Ghost is selected, I would like to hide option Retail and Prepaid under the upgrade options. How do I go about this? I am able to hide the whole div container for upgrade but I only want to hide those last two options. Please some assistance would be appreciated.</p>
|
php javascript
|
[2, 3]
|
128,029 | 128,030 |
Alert message in Javascript
|
<p>I am using simple JavaScript code in my PHP code to display an alert message:</p>
<pre><code><script type="text/javascript">
window.alert("Can not Send Messages ")
</script>
</code></pre>
<p>When the alert message is displayed, the original page disappears, when I press "OK" button in the message box, the original page will appear again. Is there any way to display the error message and to keep the original page in the back? My other question, is there any way to decorate the message box ^_^ ? </p>
<p>Thanks and Regards for all.</p>
|
php javascript
|
[2, 3]
|
598,923 | 598,924 |
.sortable() adding 50px height, dispurts scrollbar
|
<p>I have a draggable list of elements. The only jQuery I am using is:</p>
<pre><code>$('.section_rows').sortable();
</code></pre>
<p>This works fine. However, when I am at the bottom of the page (vertical scroll all the way at the bottom), and click a row to drag and sort it, the page 'jumps' up by <code>55px</code>. While this isn't a big deal functionally, it is a terrible user experience (and the draggable rows are located at the bottom of this page, so this hiccup invariably happens).</p>
<p>I took a look at the HTML, and it looks like jQuery is adding a class called <code>'.ui-sortable-helper'</code> which contains a style with a 55px height.</p>
<p>Is there a way that I can disable this or force the page to 'not move' when the draggable item is selected?</p>
|
javascript jquery
|
[3, 5]
|
3,610,373 | 3,610,374 |
how to delete all sms of a specific contact number in android
|
<p>I have the following code which delete all the sms conversation ,</p>
<pre><code>Uri inboxUri = Uri.parse("content://sms/conversations");
int count = 0;
Cursor c = context.getContentResolver().query(inboxUri , null, null, null, null);
while (c.moveToNext()) {
try {
// Delete the SMS
String pid = c.getString(0); // Get id;
String uri = "content://sms/" + pid;
count = context.getContentResolver().delete(Uri.parse(uri),
null, null);
} catch (Exception e) {
}
}
return count;
</code></pre>
<p>but i want to delete sms of a specific contact number, What to do?</p>
|
java android
|
[1, 4]
|
1,584,755 | 1,584,756 |
javascript vs server event conundrum- iOS
|
<p>Ok here is my problem, I've inherited an old ASP.NET 2 website which I've been asked to make iOS capable. My biggest headache so far is that because of the way you have to log into the system right now I need to pass the UserName to the iphone and also run the server Click event. I can do one or the other but not both, and hooking up to the username textbox via either the KeyUp event or the OnChanged event causes other problems with the Objective-C code for the iPhone. </p>
<p>Is there anyway that I can update both the phone and the server at basically the same time?</p>
|
javascript iphone asp.net
|
[3, 8, 9]
|
3,248,521 | 3,248,522 |
What is the best way to load/choose "controller" classes
|
<p>I'm not sure if i'm using the correct terminology but I have several Controller classes that return objects using different data sources in my ASP.NET web app. ie </p>
<pre><code>Product p = ProductController.GetByID(string id);
</code></pre>
<p>What I want to be able to do is use a controller factory that can select from different ProductControllers. I understand the basic factory pattern but wondered if there was a way to load the selected cotroller class using just a string. </p>
<p>What I want to achieve is a way of returning new/different controllers without having to update a factory class. Someone suggested i look at dependency injection and MEF. I had a look at MEF but I've been having trouble figuring out how to implment this in a web app. </p>
<p>I'd love to get some pointers in the right direction.</p>
|
c# asp.net
|
[0, 9]
|
4,634,753 | 4,634,754 |
How to redirect to a specific page from a JS dispalyed page in asp.net
|
<p>I have an asp.net application with master page. In one of the pages I have a button click event which opens another page using javascript as shown below. </p>
<pre><code>string urlVerify = "VerifyEnrollmentEntries.aspx";
string fullURLVerify = "var newVerifyDataWindow = window.open('" + urlVerify + "','_blank','height=600,width=950,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );
ClientScript.RegisterStartupScript(this.Page.GetType(), "OpenWindow", fullURLVerify, true);
</code></pre>
<p>This popup page doesn't have a master page. This is just a stand alone page, but part of the project. When the user clicks the close button on this popup page, I want to close this page and redirect to a specific page in the asp.net. Right now when the close button is clicked, the page closes and the parent page which caused the popup is shown. </p>
<p>Any help is greatly appreciated.</p>
<p>Thanks</p>
|
javascript asp.net
|
[3, 9]
|
995,366 | 995,367 |
Onclick event for image tag inside PHP echo, is not working
|
<p>In my image.php file i have code</p>
<pre><code>$id=abs($_GET['id']);
$query = mysql_query("SELECT image FROM table1 WHERE id=$id");
$data=mysql_fetch_array($query);
header('Content-type: image/jpg');
echo $data['image'];
</code></pre>
<p>And while retrieving i am using query</p>
<pre><code>$query = mysql_query("SELECT id FROM table1");
while($data=mysql_fetch_array($query)) {
echo '<'.'img src="image.php?id='.$data['id'].'">';
</code></pre>
<p>It is perfectly displaying images from my data base...
But i want to detect which image user clicked for that i tried </p>
<pre><code>echo '<'.'img src="image.php?id='.$data['id'].'" onclick="doSomething()">';
</code></pre>
<p>this onclick java script function doesn't getting call..(i am using mozilla fire fox)
I am new to PHP. </p>
<p>Finally I need to detect the clicked image among the images which are displayed using PHP echo from Mysql.Is there any other way that i can follow for this?</p>
|
php javascript
|
[2, 3]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.