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,799,133 | 4,799,134 | Html Text Editor problem | <p>Hii,</p>
<p>I m using a simple HTML Text editor by providig 'contentEditable' property of a div to true. All the formatting operations are working fine. The problem is when i copy and paste some html contents from somewhere else and try to post to DB the entire content may not post in to db because of the size limitation of the column. Is there any solution regarding this? <strong>I m using sql server 2008</strong> </p>
| asp.net javascript | [9, 3] |
3,249,754 | 3,249,755 | How to automate a click on page load? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7943287/auto-click-on-page-load">Auto click on page load</a> </p>
</blockquote>
<p>I need to click on the specified xy position on a page without clicking it using a mouse. I have tried many jquery and js scripts, but they did not worked for me. I want an equivalent to manual mouse click. Is it possible? I am a beginner in js and jquery.</p>
| javascript jquery | [3, 5] |
2,909,999 | 2,910,000 | jQuery change callback context | <p>I am wondering how to change the context of a a jQuery callback function so that <code>this</code> is the same as it is in the parent function.</p>
<p>Take the following example:</p>
<pre><code>var context = this;
console.log(context);
element.animate(css, speed, type, function () {
var new_context = this;
console.log(new_context);
});
</code></pre>
<p>How would I make it so that <code>new_context</code> is equal to <code>context</code>?</p>
<p>I realise I could do this:</p>
<pre><code>var new_context = context;
</code></pre>
<p>But is there a better way of telling the function to use a different context?</p>
| javascript jquery | [3, 5] |
5,692,565 | 5,692,566 | Parsing string to Json in the Constructor | <p>HY!!</p>
<p>I have a Json class, so i will parse in the constructor the json string to JSonObject.</p>
<pre><code> public class JSONParse extends JSONObject {
public JSONParse(string json) {
//pseudo code
this.obj = new JSONObject(EntityUtils.toString(json));
}
}
</code></pre>
<p>please help</p>
| java android | [1, 4] |
2,540,549 | 2,540,550 | 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] |
1,270,323 | 1,270,324 | JS/PHP: Who is responsible for generating the content? | <p>Here's a situation which I have encountered, creating a form on the client side and using PHP to process. Here are some considerations</p>
<ol>
<li>The PHP script generates the form and send to the client side. This is because of internationalization issues</li>
<li>The client side uses JavaScript to submit form; the ID of the form is hard-coded inside the JavaScript as it is generated by PHP. This means everytime the PHP code is updated, the JS must change.</li>
</ol>
<p>The question here is, who should be dependent on who? Should the JS generate the form instead, so that the PHP script has to know the names of the form elements? OR should it be the other way round?</p>
| php javascript | [2, 3] |
2,885,150 | 2,885,151 | validate CKEditor with jQuery Validation plugin | <p>how to validate CKeditor with jQuery validation plugin.</p>
<p>This is my code</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("#newpost").validate({
debug: false,
rules: {
title: "required",
cat_id: "required",
editor1:"required"
},
messages: {
title: " Title name cannot be blank.",
cat_id: " Please select a category.",
editor1: " Post keywords cannot be blank."
},
submitHandler: function(form) {
// do other stuff for a valid form
$.post('new_post.php', $("#newpost").serialize(), function(data) {
$('#msgw').html(data);
});
}
});
});
</script>
</code></pre>
<p>PHP code:</p>
<pre><code><?php
include ('../db.php');
$title = mysql_real_escape_string($_POST['title']);
$editor1 = $_POST['editor1'];
$date= date("Y-m-d");
$cat_id = mysql_real_escape_string($_POST['cat_id']);
$qu = mysql_query("INSERT INTO blogposts(title,post,date,catid)VALUES ('".$title."','".$editor1."','".$date."','".$cat_id."')") or die (mysql_error());
?>
</code></pre>
<p>problem is it dosent even post the contain in the editor. how can i fix this problem. thank you.</p>
| php jquery | [2, 5] |
353,257 | 353,258 | Has Java just not kept up? | <p>I code C# all day, but recently made a jump to Java for hobby stuff, like writing for the BlackBerry and Android platforms. All this time I assumed that as far as language features go, Java and C# were twins of each other. </p>
<p>Anyway, I discovered that Java is the equivalent of C# 1.1 or something like that. In Java, I have to write twice the code that I would in C#. Are features like object initializers, lambda, properties for god's sake, ever coming to Java? I tried to wade through the JSR stuff, but couldn't find anything.</p>
<p>Has Java simply not kept up? Or am I simply not using it as it is intended?</p>
| c# java | [0, 1] |
5,336,266 | 5,336,267 | How to get file name from a specified folder? | <p>I want to get the file name resides under a specified folder.</p>
<p>i.e. there is a file stored under two folders <code>First\Second\test.txt</code> I want have the path of the parent directory of file that is <code>First\Second\</code> in my program. Now I want to get the file name residing under the directory "Second" using code.</p>
<p>Please help me.</p>
| c# asp.net | [0, 9] |
5,345,006 | 5,345,007 | ASP.net viewstate links error | <p>When the contents is placed inside the contentplaceholder, the behavior of the links are changed, I have to refresh the page to make the download links functional. I also have to remove the form tag when I place the contentplaceholder. How do I fix the behavior of the links while having a contentplaceholder to reference my master page? (some code removed to shorten and privacy) </p>
<pre><code><asp:Content runat="server" ContentPlaceHolderID="PlaceHolderMain">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
<title></title>
<style type="text/css">
</style>
</head>
<body>
<%--<form id="ThisForm" runat="server">--%>
<div>
<table style="width:100%;">
</table>
</div>
</body>
</html>
</asp:Content>
</code></pre>
| c# asp.net | [0, 9] |
4,305,012 | 4,305,013 | Setting a greeting based on user's time (Good morning, good afternoon…) | <p>I'm sort of lost. Can anyone extrapolate on how to implement a basic "good evening" or "good morning" based on the user's time setting? </p>
<p>Perhaps PHP will fetch the server time, but I'm looking to greet the site visitor with a time-based appropriate greeting that considers their time of day. </p>
<p><strong>E.G.:</strong> good morning, good night, good afternoon. </p>
<p>Thanks folks :)</p>
| php javascript jquery | [2, 3, 5] |
1,971,585 | 1,971,586 | .Net HttpHandler not working in android device | <p>I have created ASP.Net httphandler to count number of visits for MP3 files. Httphandler is being used in web application as well as in ios + android application.</p>
<p>It is working fine in web + ios application. If I run android application in Samsung Galaxy S then it is playing MP3 files perfectly but it is not working in Samsung Galaxy Ace mobile. </p>
<p>I do not know what is wrong in my asp.net code. Below is code of httphandler. </p>
<pre><code>public class MP3DownloadHanlder : IHttpHandler , IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
//Here I increment number of visit by filename in request
string filename = context.Request.QueryString["Title"] + ".mp3";
string path = context.Server.MapPath("audio");
string file = path + "\\" + filename;
if (System.IO.File.Exists(file))
{
FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read);
context.Response.Buffer = true;
context.Response.Clear();
context.Response.ClearContent();
context.Response.ClearHeaders();
context.Response.AddHeader("content-disposition", "attachment; filename=" + filename);
context.Response.AddHeader("content-length", fs.Length.ToString());
context.Response.ContentType = "audio/mpeg";
byte[] bytes = new byte[fs.Length];
int bytesToRead = (int)fs.Length;
int bytesRead = 0;
while (bytesToRead > 0)
{
int n = fs.Read(bytes, bytesRead, bytesToRead);
if (n == 0) break;
bytesRead += n;
bytesToRead -= n;
}
bytesToRead = bytes.Length;
context.Response.OutputStream.Write(bytes, 0, bytes.Length);
}
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
}
</code></pre>
<p>Please help me. It is urgent for me</p>
<p>Regards,
Viral</p>
| c# android asp.net | [0, 4, 9] |
4,358,680 | 4,358,681 | jquery sort multiple lists | <p>I would like to sort several ULs with jquery. The criteria is that the LI containing the text "current" must be moved to the top of that list.</p>
<p>example</p>
<pre><code><ul>
<li>doc1</li>
<li>doc5</li>
<li>doc3</li>
<li>doc54 (current)</li>
<li>doc1</li>
</ul>
</code></pre>
<p>would become</p>
<pre><code><ul>
<li>doc54 (current)</li>
<li>doc1</li>
<li>doc5</li>
<li>doc3</li>
<li>doc1</li>
</ul>
</code></pre>
<p>(but there are many of these lists on the page, all different and not always containing an item which is labeled "current" which all must be sorted)</p>
<p>Help would be appreciated. JSFiddles even more appreciated.</p>
| javascript jquery | [3, 5] |
3,772,443 | 3,772,444 | Onmouseover running multiple times while hovering on element? | <p>Why does onmouseover run multiple times while I hover over one element?</p>
<p>I'm trying to run a simple animation when the user hovers over an icon but it runs multiple times.</p>
<p>I'm testing it here:</p>
<p><a href="http://lujanventas.com/test.php" rel="nofollow">http://lujanventas.com/test.php</a></p>
<p>Anyway, any ideas on how to fix it? maybe using a listener instead?</p>
<p>This is the javascript running onmouseover:</p>
<pre><code>function upIcon(n) {
console.log("Mouseover icon: " + n);
$('#icon' + n).animate({ backgroundPositionY : "-=15px" }, 200 );
$('#icon' + n).animate({ backgroundPositionY : "+=15px" }, 200 );
}
</code></pre>
| javascript jquery | [3, 5] |
2,330,492 | 2,330,493 | external JS does not work | <p>I have the following code:</p>
<pre><code><script language="javascript" type="text/javascript">
$.fn.dataTableExt.oPagination.input = {
"fnInit": function (oSettings, nPaging, fnCallbackDraw) {
....
},
"fnUpdate": function (oSettings, fnCallbackDraw) {
....
}
};
</script>
</code></pre>
<p>and it works, but when I create external file and put this code inside this file (of course without <code><script></script></code> ) - it does not work. Why?</p>
| javascript jquery | [3, 5] |
3,022,752 | 3,022,753 | Click event on dynamically created link buttons not working | <p>I want to give option to upload multiple files and then download it. I am creating link buttons Dynamically like: </p>
<pre><code> private void AddLinkButtons()
{
string[] fileNames = (string[])Session["fileNames"];
string[] fileUrls = (string[])Session["fileUrls"];
if (fileNames != null)
{
for (int i = 0; i < fileUrls.Length - 1; i++)
{
LinkButton lb = new LinkButton();
phLinkButtons.Controls.Add(lb);
lb.Text = fileNames[i];
lb.CommandName = "url";
lb.CommandArgument = fileUrls[i];
lb.ID = "lbFile" + i;
//lb.Click +=this.DownloadFile;
lb.Attributes.Add("runat", "server");
lb.Click += new EventHandler(this.DownloadFile);
////lb.Command += new CommandEventHandler(DownloadFile);
phLinkButtons.Controls.Add(lb);
phLinkButtons.Controls.Add(new LiteralControl("<br>"));
}
}
</code></pre>
<p>And my DownloadFile event is:</p>
<pre><code>protected void DownloadFile(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
string url = lb.CommandArgument;
System.IO.FileInfo file = new System.IO.FileInfo(url);
if (file.Exists)
{
try
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
catch (Exception ex)
{
}
}
else
{
Response.Write("This file does not exist.");
}
}
</code></pre>
<p>I am getting link buttons on screen but DownloadFile event is never called after clicking. i tried all options that are commented, but its not working. What is wrong in code?</p>
| c# asp.net | [0, 9] |
1,744,577 | 1,744,578 | Display Registration details in Website from Database | <p>Hi
i am using a website application for registration, in that application i have inserted contols like label boxes and text boxes... And i stored these values in database...</p>
<p>now i have to display the details only without controls in seperate form and the details should take from that database...</p>
<p>How Shall i Do this?</p>
<p>The output should display in next form... the format is</p>
<p>Name:Jessy
RollNo:6315
City:ParkTown</p>
<p>Thanks In Advance</p>
| c# asp.net | [0, 9] |
5,116,174 | 5,116,175 | The process cannot access the file, because it is being used by another process | <p>I am creating a file in local drive with content by using below code. </p>
<pre><code>File.WriteAllLines(path, contents);
</code></pre>
<p>I am attaching this file to a mail and sending acrross the team. Once mail sent I need to delete the file, to delete the file I am using below code but I am getting runtime error</p>
<pre><code>File.Delete(path);
</code></pre>
<p><strong>Error Message</strong> : The process cannot access the file, because it is being used by another process</p>
<p>by default WriteAllLines() method closes the file but still it is opened by another process. I can only delete the file by executing the code after sometime but this is not the scenario. I need to delete it once the mail has been sent. </p>
<p><strong>Update</strong></p>
<pre><code>System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage();
mailMessage.To.Add(new System.Net.Mail.MailAddress(recipient, ToName));
mailMessage.From = new System.Net.Mail.MailAddress(From, FromName);
mailMessage.Subject = Subject; // "Outlook calendar as attachment"; // modified by Srikanth J on 28/06/2012
mailMessage.Body = "This is a test message";
System.Net.WebClient webclient = new System.Net.WebClient();
webclient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
for (int i = 0; i < item.Attachments.Count; i++)
{
string url = item.Attachments.UrlPrefix + item.Attachments[i];
SPFile file = item.ParentList.ParentWeb.GetFile(url);
mailMessage.Attachments.Add(new System.Net.Mail.Attachment(file.OpenBinaryStream(), file.Name));
}
System.Net.Mail.Attachment mailAttachment = new System.Net.Mail.Attachment(path);
mailMessage.Attachments.Add(mailAttachment);
smtp.Send(mailMessage);
</code></pre>
<p>Any help is appriciated, Thank you.</p>
| c# asp.net | [0, 9] |
2,006,742 | 2,006,743 | Created API for twitter to display latest 5 posts | <p>is there created API for twitter to display latest 5 posts for non-wordpress website? I got website coded in php/html/css (without cms), and I need to add twitter box, where there is shown latest 5 tweets, from user. Is there any created API for this already?</p>
| php javascript | [2, 3] |
2,711,991 | 2,711,992 | How do I target a jquery click function where identical links exist (ie within a php foreach)? | <p>Similar to what Facebook does on its newsfeed, I want to allow commenting on numerous feed items, which I'm pulling via a php foreach statement. This is creating identical classes. So when I click .show_comments it activates everything.</p>
<p>I went through SO and found something akin to what you see below...but it's not working for me.</p>
<p>How do I target individual .show_comments to animate and toggle the selected item?</p>
<pre><code>$j(function() {
$j(this).find('.show_comments').click(function(){
$j(this).find('.comments').slideDown("fast");
$j(this).find(".answer_comments").toggle();
});
$j(this).find('.hide_comments').click(function(){
$j(this).find('.comments').slideUp("fast");
$j(this).find(".answer_comments").toggle();
});
});
</code></pre>
| javascript jquery | [3, 5] |
5,125,537 | 5,125,538 | Using variables in .css() with Jquery | <p>I'm running into a rather odd problem that I just can't seem to solve. I'm trying to use a variable in the .css() but it doesn't work. However if I type in 'background-color' directly within the .css() call it does. What gives?</p>
<pre><code>var css = that.data('css');
var targets = that.data('targets');
var value = that.val();
console.log(css + ' ' + targets + ' ' + value);
console.log(css === 'background-color');
// returns true
$(targets).css({
css: value
});
// Doesn't work!
$(targets).css({
'background-color': value
});
// Works ok!
</code></pre>
| javascript jquery | [3, 5] |
594,331 | 594,332 | how to convert time in string format into date time format using C# | <p>i have textbox that accepts time format like this 12:40 PM but would like to convert it into time format like this 12:40:00 basically without the PM or AM. Here is what i have so far:</p>
<pre><code>string StartTime = ((TextBox)TestDV.FindControl("txtBST")).Text.ToString();
</code></pre>
<p>thanks</p>
| c# asp.net | [0, 9] |
5,985,617 | 5,985,618 | how to write client side events functions for the combobox items | <pre><code><dx:ASPxComboBox ID="ASPxComboBox2" runat="server" ClientIDMode="AutoID"
SelectedIndex="-1" onselectedindexchanged="ASPxComboBox1_SelectedIndexChanged1" >
<ClientSideEvents SelectedIndexChanged="function(s, e) {
grid.SelectRows();}" />
<Items>
<dx:ListEditItem Text="Selecte All Rows" />
<dx:ListEditItem Text="UnselectAll" />
</Items>
</dx:ASPxComboBox>
</code></pre>
<p>I want to write event for the "unselect all" item in combobox. How can I do this?</p>
| c# asp.net | [0, 9] |
4,609,819 | 4,609,820 | How to enable the default highlight menus in android webview? | <p>How to enable the default text highlights menu like: Copy/Paste/Search/Share in android webview ?</p>
<p><img src="http://i.stack.imgur.com/Jt89M.png" alt="enter image description here"></p>
| java android | [1, 4] |
4,317,653 | 4,317,654 | javascript/jQuery: Clicking anywhere to trigger a function but on a particular button | <p>I want to trigger a function by clicking anywhere except an asp.net button.</p>
<pre><code><script>
$(document).ready(function () {
$(document).click(function () {
Test();
});
});
</code></pre>
<p>and</p>
<pre><code><asp:Button ID="btnSave" runat="server" Text="SaveChanges" OnClick="btnSave_Click" />
</code></pre>
<p>How to modify my javascript code?</p>
<p>Thanks. </p>
| javascript jquery asp.net | [3, 5, 9] |
657,350 | 657,351 | Recentering divs on window resize gets me "Uncaught TypeErrors" | <p>I have got a modal window set-up on my page that works fine, but needs repositioning on window resize in order to stay centred. Unfortunately, I simply get the error:</p>
<blockquote>
<p>Uncaught TypeError: Object # has no method 'outerHeight'</p>
</blockquote>
<p>Am I using "this" incorrectly?</p>
<pre><code> $(window).resize(function() {
//If mask is open, resize modal elements
if ($('#modalMask').is(':visible')) {
//Resize and position modal windows
//Get window dimensions
var mWinHeight = $(window).height();
var mWinWidth = $(window).width();
//Make sure all open modal windows are centred
$('.modalWindow:visible').each(function (i) {
var $this = $(this);
$this.css('top', mWinHeight/2-(this.outerHeight()/2));
$this.css('left', mWinWidth/2-(this.outerWidth()/2));
});
}
});
</code></pre>
| javascript jquery | [3, 5] |
129,965 | 129,966 | What does this error code mean ( code attached) | <pre><code>@Override
public void onCancel() {
// TODO Auto-generated method stub
</code></pre>
<p>ERROR:The method onCancel() of type SoftKeyboard must override a superclass method SoftKeyboard.java /EmotePractice/src/com/emote line 691 Java Problem</p>
<p>Superclass?? I thought @Override was meant to catch errors made with grammar, why is it saying this?</p>
| java android | [1, 4] |
36,340 | 36,341 | Need help with jquery/javascript setInterval | <p>Currently im developing a user notification alert message function.</p>
<p>I managed to use setInterval to control my Ajax call (to check if there's any notifcation msg for the user). But my problem is that I only wanted the notfication message only
appear once on the page (Now it displays multiple notification alert msg on the screen). </p>
<p>I know that you can us setTimeout to make it only call once but I also needed the page to check
if there's a new notifcation message alert in every 5min.</p>
<p>Second question is it possible the first round calling the Ajax call instantly n then all other calls every 5min? because I wanted the system to check instantly once they logged into the system n then afterward every 5min.</p>
<p>Thanks so much in advance!</p>
<p>Here is my code</p>
<pre><code> <script type = "text/javascript">
function getAjaxNotice()
{
$.post("/async/getnotification" , {},
function(response)
{
var notice = $(response);
$("#notices").prepend(notice);
});
return false;
}
setInterval( "getAjaxNotice()", 50000 );
</script>
</code></pre>
| javascript jquery | [3, 5] |
3,603,553 | 3,603,554 | What's the relationship between c# and asp.net? | <p>Are the two the same thing or ?</p>
| c# asp.net | [0, 9] |
3,416,478 | 3,416,479 | Change element style after .get() success | <p>I'm new to JS. I'm trying to change button's background-color after .get() success.</p>
<p>Here is example: <a href="http://jsfiddle.net/csTpG/95/" rel="nofollow">http://jsfiddle.net/csTpG/95/</a></p>
<p>What's wrong with my code?</p>
<hr>
<pre><code>$('.add').click(function() {
var productID = $(this).attr('name');
$.get('/',{item_id : productID}, function() {
$(this).addClass('clicked');
});
return false;
});
</code></pre>
<hr>
<pre><code><button class="add">click me</button>
</code></pre>
| javascript jquery | [3, 5] |
5,052,817 | 5,052,818 | Upload multiple photos to facebook from android (facebook sdk 3) | <p>I am trying to upload all photos in my sdcard folder to facebook album . I have written the following code for the same. is the list of all the image files. But, programs runs in to exception. I am not able to figure out the reason. Any inputs in this regard are welcome .</p>
<pre><code> RequestBatch requestBatch = new RequestBatch();
for (final String requestId : fileNames) {
Bitmap image = BitmapFactory.decodeFile(requestId);
Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), image, new Request.Callback() {
@Override
public void onCompleted(Response response) {
showPublishResult("Photo Post ", response.getGraphObject(), response.getError());
}
});
requestBatch.add(request);
}
requestBatch.executeAsync();
}
</code></pre>
<p>Update :</p>
<p>It is running into OutOfMemoryException. That means, the sdk is caching the files, and as a result this is happening . Is there any other way to achieve the same, rather than sending the bitmap image as request ?</p>
| java android | [1, 4] |
4,366,968 | 4,366,969 | Javascript for check and uncheck detection for the checkbox list control | <p>I want to write javascript logic for the check box list asp.net control, that if some condition in check box selection is true then select all, else deselect all.
How to figure out this check uncheck and there value using javascript? </p>
| javascript asp.net | [3, 9] |
3,422,440 | 3,422,441 | serialize and post array to a process file | <p>I'm trying to post an array to another file to be processed. The array is below and it populates rows properly. I have it initialized at the beginning of the script tag to make it global.<br>
In javascript:</p>
<pre><code>var locationsall = new Array();
locationsall[counter] = new Array();
locationsall[counter][0] = address;
locationsall[counter][1] = lat;
locationsall[counter][2] = lng;
</code></pre>
<p>In my form i try to serialzie it and post it</p>
<pre><code> <input type="hidden" name="result" value="<?php echo serialize($locationsall); ?>">
</code></pre>
<p>When i try to unserialize it, it doesn't have anything..</p>
<pre><code> $locations = unserialize($_POST['result']);
</code></pre>
<p>What am i doing wrong here?</p>
| php javascript | [2, 3] |
4,131,205 | 4,131,206 | How to integrate quickbook into asp.net c# website? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7083744/what-is-the-best-way-to-integrate-with-quickbooks-from-c-sharp-code">What is the best way to integrate with quickbooks from C# code?</a> </p>
</blockquote>
<p>I have created a asp.net website and I want to integrate quick-book into my website in the accounting section. To do you know process to install quick-book into my website.</p>
| c# asp.net | [0, 9] |
1,707,636 | 1,707,637 | Handling threads in Android | <p>I have an application which has some background processes, like downloading an XML from a server and parsing it, and I am performing these tasks in Threads.</p>
<p>The problem comes when sometimes a thread does not get CPU time for long time, it could be anytime between 15 minutes to some hours, and then the thread starts behaving properly.</p>
<p>How should I handle this?</p>
| java android | [1, 4] |
3,976,622 | 3,976,623 | problem with jquery | <p>I'm beginner in jquery.this is my first application.</p>
<pre><code><head>
<title>Untitled Document</title>
<script type="text/javascript" src="../jquery-1.6.2.min.js"></script>
<script type=”text/javascript”>
$(document).ready(function(){
$("a").click(function(){
alert("Hello World");
});
});
</script>
</head>
<body>
<a href=”#”>Click me!</a>
</body>
</html>
</code></pre>
<p>but when i click on <code>Click me</code> the alert doesn't showed.what is problem?
(the lib address(<code>src="../jquery-1.6.2.min.js</code>) is correct )</p>
| javascript jquery | [3, 5] |
4,571,632 | 4,571,633 | using SQL to Create a Login page in Visual Studio 2010 | <p>I am a beginner in .Net. I created a login page with an SQL connection in Visual Studio 2008.
But I want to use the code in Visual Studio 2010.</p>
<p>Please help me.</p>
| c# asp.net | [0, 9] |
504,506 | 504,507 | If body class equals X then do something? | <p>I have this code running from an external script for an image slider for every page on a site. </p>
<pre><code>$(document).ready(function() {
$("#slideshow").show();
$('#slider1').anythingSlider({
buildNavigation: false,
delay: 8000
})
</code></pre>
<p>On one of the pages I don't want the image slider to rotate automatically so I need to add an extra variable. I've put a class on the body of the page and want to do something along the lines of...</p>
<p><strong>If the body has a class of 'partnerCharitiesDetail' then run this script instead of the generic one</strong> </p>
<p>This is what I have tried below (without success). I have 2 questions really, </p>
<p>1) What happens in jQuery when there are 2 identical scripts running (like this example), will it overwrite the older one with the newer one?</p>
<p>2) Where am I going wrong?! Is my approach the best way to do it?</p>
<pre><code>$(document).ready(function() {
$("#slideshow").show();
$('#slider1').anythingSlider({
buildNavigation: false,
delay: 8000
})
if ($('body.partnerCharitiesDetail').length > 0){
$('#slider1').anythingSlider({
buildNavigation: false,
delay: 8000,
startStopped: false
})
}
</code></pre>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
4,155,392 | 4,155,393 | How to find index based on sorted elements among siblings.? | <pre><code><div id="container">
<div class="aa"></div>
<div class="bb"></div>
<div class="aa"></div>
<div class="bb"></div>
<div class="bb"></div>
<div class="bb"></div>
<div class="bb"></div>
</div>
</code></pre>
<p>i just need to find the index of element based on particular class while looping.</p>
<p>Normal index will give the element index no: among the siblings.
I want to consider siblings with same class only, and give the index based on that sorted siblings.</p>
<pre><code>$("#container div").each(function(){
if($(this).hasClass('bb')){
var index = $(this).index();
//will give me 1,3,4,5 etc
//I want 0,1,2 etc ie: list the index based on class
}
if($(this).hasClass('aa')){
var index = $(this).index();
//will give me 0 , 2
//I want 0,1 etc ie: list the index based on class
}
})
</code></pre>
| javascript jquery | [3, 5] |
1,804,419 | 1,804,420 | in $.extend class how to call internal functions? | <p>Why it doesn't work,it say its not a function,why can't I call myalert() from myalert2?? How to do??</p>
<pre><code>var sheepclass = function(handler) {
this.handler = $.extend({
'sizes': 'thin',
'eat': 'grass',
'color': 'white',
myalert: function() {
alert('Hello World');
},
myalert2: function() {
handler.myalert();
this.handler.myalert(); //this not work either
}
}, handler);
}
var blacksheep = new sheepclass({
'color': 'black'
});
blacksheep.handler.myalert2();
</code></pre>
| javascript jquery | [3, 5] |
4,428,973 | 4,428,974 | How to check if VERTEX ARRAY is clockwise? | <p><strong>Solved</strong>, used this code:</p>
<pre><code>if ( !isClockwise(TempVectArray) ) { Collections.reverse(TempVectArray); }
</code></pre>
<p>...</p>
<pre><code>private boolean isClockwise(ArrayList<Vec2> arl){
Iterator<Vec2> it = arl.iterator();
Vec2 pt1 = (Vec2)it.next();
Vec2 firstPt = pt1;
Vec2 lastPt = null;
double area = 0.0;
while(it.hasNext()){
Vec2 pt2 = (Vec2) it.next();
area += (((pt2.x - pt1.x) * (pt2.y + pt1.y)) / 2);
pt1 = pt2;
lastPt = pt1;
}
area += (((firstPt.x - lastPt.x) * (firstPt.y + lastPt.y)) / 2);
return area < 0;
}
</code></pre>
<hr>
<p>Suppose I get a vertex array from the user tapping on the screen, but need it to be clockwise.</p>
<p>Maybe you know of some standard methods to check if it is clockwise and if it's not, then make it clockwise?</p>
<p><img src="http://i.stack.imgur.com/IvBaU.png" alt="enter image description here"></p>
<p>Thanks!</p>
| java android | [1, 4] |
2,426,166 | 2,426,167 | How can I tweet in twitter account from an android imulator? | <p>Here, I have an edit text and a button, I want to tweet what i write something in edit text after clicking the button.</p>
| java android | [1, 4] |
2,594,700 | 2,594,701 | Android Getting value from an Integer arraylist becomes a number | <p>I am new to Android and from what I read here most of the question goes to Imageview setting image. Here is my problem same as ImageView errors
Ive created a arraylist of Integer because of some function needed Int List rather than String List. Basically like most of function I created it like this one </p>
<pre><code>private ArrayList<Integer> myArrayList = new ArrayList<Integer>();
public void setPicture(Integer datanumber)
{
if (datanumber>=10)
{
myArrayList.add(R.drawable.picture);
}
else{
myArrayList.add(R.drawable.picture_gray);
}
///and so on
}
</code></pre>
<p>Everything works fine until I found out that I cannot get this string ex "R.drawable.picture" using this code</p>
<pre><code> myArrayList.get(0).toString();
</code></pre>
<p>Instead it gives me random number that I cannot understand.
My question is how can I return it to default value(or the one that I add on my list)
Thank you for spending time reading my question</p>
| java android | [1, 4] |
285,767 | 285,768 | .prevUntil not working as expected | <p>what am I doing wrong in this code..</p>
<p>I should get the class name of the previous sibling using this code.. but I am getting undefined..where am I going wrong</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JprevUntil</title>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script>
$('.clickme').live('click',function(){
alert($(this).prevUntil('li.lick').className);
});
</script>
</head>
<body>
<div>
<p id="hello">Hello World</p>
<li class="lick">hello i am li</li>
<a href="#">heello i am a</a>
<p class="clickme">click</p>
</div>
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
1,408,409 | 1,408,410 | Android: resources file | <p>I have spent ages trying to find out how to get the directory of the resources file (<code>res/raw</code>) for months now... I just can't find out how to do it...</p>
<p>I'm attempting to get the directory of <code>res/raw</code> so that I can use <code>listFiles()</code> to make an array containing all the files in the raw folder so that I may get the file names and sort which files I will use or not through there names (as I can then access them through <code>R.raw.concat(fileIwantToAccess)</code>) but I need to be able to read all the files in the folder so that I can decide which I use</p>
<p>Is there an easier way to tell Android, that I would like the contents of this folder?</p>
<p>btw, Ive tried using </p>
<pre><code>String directoryName = Soundboard.this.getFilesDir().getParent();
</code></pre>
<p>but it returns the path: <code>/data/data/com.soundboard</code>
which has the two sub directories: "lib" and "files", if I then concat both directories to directoryName before I make the File it returns nothing when I use <code>listFiles();</code> but not null, it returns <code>[]</code></p>
<p>Please help... I am hopelessly lost</p>
| java android | [1, 4] |
3,149,877 | 3,149,878 | Javascript Error onload image fadeIn | <p>I am getting an inconsistent error with my script. Often times everything works fine, however, every now and then I am getting the following error: <code>ReferenceError: fadeIn is not defined</code></p>
<p>Here is the relevant code:</p>
<p>In the <code><head></code></p>
<pre><code> <script type="text/javascript" charset="utf-8">
window.fadeIn = function(obj) {
var item = $(obj).parent();
item.fadeIn(1000);
}
</script>
</code></pre>
<p>In the <code><body></code></p>
<pre><code> <div class="item" style="display:none"><img onload="fadeIn(this)" src="/uploads/thumbs/{{image.url}}"><br>{{ image.description }}</div>
</code></pre>
<p>Again, The images are loading and fading in most of the time but every now and then I get the error and the images do not fade in. </p>
<p>Is there a better way to approach this? Or just something I'm missing?</p>
| javascript jquery | [3, 5] |
1,760,461 | 1,760,462 | define function within another function in javascript | <pre><code>function foo(a) {
if (/*some condition*/) {
// perform task 1
// perform task 3
}
else {
// perform task 2
// perform task 3
}
}
</code></pre>
<p>I have a function whose structure is similar to the above. I want to abstract <em>task 3</em> into a function, <code>bar()</code>, but I wish to limit the access of this function to only within the scope of <code>foo(a)</code>.</p>
<p>To achieve what I want, is it right to change to the following?</p>
<pre><code>function foo(a) {
function bar() {
// perform task 3
}
if (/*some condition*/) {
// perform task 1
bar();
}
else {
// perform task 2
bar();
}
}
</code></pre>
<p>If the above is correct, does <code>bar()</code> get redefined every time <code>foo(a)</code> gets called? (worrying about waste of cpu resource here)</p>
| javascript jquery | [3, 5] |
3,064,534 | 3,064,535 | Preloader for dynamic content | <p>I have dynamic page which takes about <strong>8 seconds</strong> to load searched data.</p>
<p>Problem is, all <strong>browsers remain on old page</strong> for those 8 secs & <strong>show dynamic page</strong> only after it</p>
<p><strong>loads completely.</strong></p>
<p>What I want is <strong>preloder image</strong> to be shown to the customers until second page gets load.</p>
<p>How can I achieve this?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
2,158,279 | 2,158,280 | passing values from java script to php | <p>can any one please help how to get the values from the javascript to php other than while using submit button.</p>
<p>scenario:
i am searching for record, if the record found then, i need confrim alert asking to continue or not, if he click continue how can i say he selected continue</p>
| php javascript | [2, 3] |
2,048,127 | 2,048,128 | issue calling JavaScript function from PHP | <p>basically I am trying to call a javascript function from my PHP and I am using code I know works in other situations however here is it not and I am at a loss as to why? </p>
<p>It may be something stupid as I have been staring at this screen for a long time :)</p>
<p>here is where I call the function:</p>
<pre><code>if(isset($test_details['done_test'])){
echo "getting here";
echo "<SCRIPT LANGUAGE='javascript'>user_error();</SCRIPT>";
}
</code></pre>
<p>I successfully get 'getting here' printed however it does not call the JS function.</p>
<p>javascript function:</p>
<pre><code> function user_error(){
document.write("working");
//alert("User has already taken this test. Your are being redirected...");
//setTimeout("window.location='home_student.php'",3000);
}
</code></pre>
<p>The commented it what I do eventually want it to do.</p>
<p>Could anyone please shed some light.</p>
<p>Many thanks,</p>
<p>@Crimson - Here is what I tried after your advice...still no luck.</p>
<p>javascript now:</p>
<pre><code>$(document).ready(function () {
var done = "<?= $test_details['done_test'] ?>";
if(typeof done != 'undefined'){
$('WORKING').appendTo('#bodyArea'); // just to test
}
});
</code></pre>
| php javascript | [2, 3] |
665,682 | 665,683 | PHP While Loop and jQuery | <p>I have created a while loop that selects random images from from my server and posts it. Now I want to add some jquery code and allow me to click on one of the images and run the slideUp() function in jQuery. Here is my problem. I can click on the first image produced in the while loop but when I click on the second image nothing happens. The slideUp() function does not work. I don't know what to do. Here is the code below.</p>
<pre><code><script src="http://code.jquery.com/jquery-latest.js"></script>
<?php
$num_dresses = dress_count ();
$i=0;
while ($i < 2){
?>
<style>
div:hover { border:2px solid #021a40; cursor:pointer;}
</style>
<script>
$("div").click(function () {
$(this).slideUp();
});
</script>
<?php
$rand_id = rand(1, $num_dresses);
$dress_feed_data = clothing_data($rand_id, 'file_name', 'user_defined_name', 'user_defined_place' , 'user_who_uploaded', 'match_1');
$new_file_name = $dress_feed_data['file_name'];
if (file_exists('fashion_images/' . $new_file_name)){
echo str_replace("|", " ", $dress_feed_data['user_defined_name']);
?>
<br>
<div>
<img src=" fashion_images/<?php echo $new_file_name;?> " width="50" height="50" />
<div>
<br><br>
<?php
echo str_replace("|", " ", $dress_feed_data['user_defined_place']);
?>
<br><br>
<?php
}
$i++;
}
?>
</code></pre>
| php jquery | [2, 5] |
4,105,000 | 4,105,001 | jQuery, how do I call a url by checking a checkbox | <p>I have this:</p>
<pre><code><span id="social">
Facebook:
<input id="id_connected_to_facebook" type="checkbox" name="connected_to_facebook">
<br>
Twitter:
<input id="id_connected_to_twitter" type="checkbox" name="connected_to_twitter">
<br>
</span>
</code></pre>
<p>and with jQuery I would like to call a different URL for all the 4 possible actions (1: check facebook, 2: uncheck facebook, 3: check twitter, 4: uncheck twitter).</p>
<p>How would I do that?</p>
| javascript jquery | [3, 5] |
2,310,041 | 2,310,042 | wrap plain text inside a div before another html element | <p>Ok, that probably doesn't make a ton of sense... let me illustrate:</p>
<p><code><div class="csl-entry">
lorem ipsum yada yada yada...
<a title="some title" rel="external" href="http://google.com">Google</a>
</div></code></p>
<p>I would like to wrap the "lorem ipsum yada yada yada..." in a <code><p></code> tag, but am unsure how to proceed without also wrapping the <code><a></code>. </p>
<p>If it's easier to do in JavaScript or jQuery, I'm fine with that, too. Much of my site is semi-dependent on a bit of JS anyway.</p>
<p>Thanks!</p>
| php javascript | [2, 3] |
2,875,973 | 2,875,974 | Why is jQuery .live() not working with my .ajaxForm() invocation here? | <p>I have some code that looks like the following:</p>
<pre><code>jQuery("[name='myform']").live('submit', function() {
$(this).ajaxForm({
target: '#someform',
beforeSerialize: function(form, options) {
alert("BeforeSerialize happening.");
jQuery('form[name=myform] input[type=submit]').attr('disabled', 'disabled').attr("value", "<%= t('labels.please_wait') %>");
return true;
}
else {
return false;
}
}
return false;
},
success: function() {
jQuery('#form_quotes_highlights_part').fadeIn('slow');
},
complete: function() {
jQuery("#wizard").expose().close();
}
});
});
</code></pre>
<p>The live() binding seems to work just fine, however the ajaxForm is not working at all. If I do something like:</p>
<pre><code> $(document).ready(function() {
/* ajax form stuff here */
});
</code></pre>
<p>It appears to work just fine. The only problem with that is, when the response comes back from the server, javascript handlers are not attaching themselves to the DOM properly, hence the use of live(). Either way, beforeSerialize is never invoked with the way I'm currently handling my live() handler, so instead of an ajaxForm, I'm having a full page submit.</p>
<p>What's the best way to clean this up?</p>
| javascript jquery | [3, 5] |
1,041,209 | 1,041,210 | Dynamically changing photo with dropdown | <p>I am new to PHP and am trying to figure out how to code some specific functionality. I have a product page that shows a photo and has two dropdown menus, one for size and one for color. What I would like to do is when the page first loads I set a variable that has the default product SKU. When the menus change I want to change the variable to the combined values of the two menu items selected. As the variable changes I want to reflect this in the photo and in a hidden form value (for eventual submission to a cart).</p>
<p>So when the page loads it shows picture A with the associated values in the size and color dropdowns. Then when either of the dropdowns change the photo dynamically changes to reflect it (while also updating the hidden form value).</p>
<p>Any suggestions would be much appreciated.</p>
| php javascript jquery | [2, 3, 5] |
3,789,536 | 3,789,537 | Android: setPictureFormat() error | <p>I'm a beginner in Andoird, currently trying to write an application using the Camera class of Android in Eclipse. The problem is when I call the parameters.setPictureFormat() method with ImageFormat.JPEG as the argument, I get an error.</p>
<p>Here's how my code looks like:</p>
<pre><code> public void surfaceChanged(SurfaceHolder holder, int format, int w, int h){
Camera.Parameters parameters = mCamera.getParameters();
parameters.setPreviewSize(854,480); // (h,w)
parameters.setPictureFormat(ImageFormat.JPEG);
parameters.set("jpeg-quality", 100);
parameters.set("orientation", "lanscape");
parameters.set("rotation", 90);
mCamera.setParameters(parameters);
mCamera.startPreview();
}
</code></pre>
<p>And I get this error in return:</p>
<pre><code>ImageFormat cannot be resolved to a variable
</code></pre>
<p>I've tried using PixelFormat.JPEG as well, but I get the same error that says "PixelFormat cannot be resolved to a variable". I've checked, it's not importing android.R. I also tried importing android.graphics.ImageFormat but it doesn't work.</p>
<p>Could anybody help point out what the problem is?</p>
| java android | [1, 4] |
891,805 | 891,806 | Jasmine does not add our .js file | <p>Instially I add <code>gem "jasmine"</code> this line in gem file and i execute this two cmds</p>
<ul>
<li><code>bundle</code></li>
<li><code>rails generate jasmine:install</code> </li>
</ul>
<p>its work fine. what my problem is, my <code>testing.js</code> file does not add in to the jasmine file.</p>
<pre><code>describe("Hello world", function() {
it("says hello", function() {
expect(helloWorld()).toEqual("Hello world!");
});
});
</code></pre>
<p>its my code, and my .js file located in public/javascript/testing.js</p>
<pre><code>function helloWorld() {
return "Hello world!";
}
</code></pre>
<p>The error message is</p>
<blockquote>
<p>ReferenceError: helloWorld is not defined in <code>http://localhost:8888/__spec__/tesfing_spec.js</code> (line 4)</p>
</blockquote>
<p>I added the path in jasmine.yml file as</p>
<pre><code>src_files:
- "public/javascript/testing.js"
</code></pre>
<p>even though it's not working. Thank you for your answers.</p>
| javascript jquery | [3, 5] |
3,110,751 | 3,110,752 | jQuery - Error: 'style' is null or not an object | <p>When I put jQuery on my page I get an error <code>Error: 'style' is null or not an object</code></p>
<p>All i did was add the following to the <code><head></code></p>
<pre><code><script type="text/javascript" src="js/jquery-1.5.js"></script>
</code></pre>
| javascript jquery | [3, 5] |
3,611,406 | 3,611,407 | What is VaryByParam in asp.net? | <p>while i am working on cache, in page directive something like VaryByParm what is this can anybody explain me. Thank you</p>
| c# asp.net | [0, 9] |
2,116,686 | 2,116,687 | Needing to have sms delayed before sending | <p>I know this has been asked multiple times, but I am having problems making it work or figuring out what will work best. I need to have the sms wait 2-3 seconds between each message before sending another message. I have looked at and tried handlers, timers and thread sleep and I am not sure which one would be the best use in my situation, or how to make it work right. I am still new to programming, so please take it easy on me.</p>
<pre><code>// ---sends an SMS message---
private void sendSMS(String phoneNumber, String message) {
int i;
SmsManager sms = SmsManager.getDefault();
int amount = 10; // just making 10 the default if the EditText has an
// invalid value
try {
amount = Integer.parseInt(smsamount.getText().toString());
} catch (NumberFormatException smsamount) {
}
if (amount < 501) {
for (i = 0; i < amount; i++) {
sms.sendTextMessage(phoneNumber, null, message, sentPI, null);
}
</code></pre>
| java android | [1, 4] |
4,708,558 | 4,708,559 | text between anchor elements in a paragraph | <p>I have a paragraph with text and anchors.</p>
<p>Given an anchor <code>$myAnchor</code> within the paragraph, I can get the immediately following one: </p>
<blockquote>
<p><code>$nextAnchor = $myAnchor.next('a');</code></p>
</blockquote>
<p>How do I get the text/HTML between these two anchors?</p>
| javascript jquery | [3, 5] |
4,064,420 | 4,064,421 | passing parameter from aspx to javascript issue | <p>I write code in asp.net backend to pass parameter, however, I found that it does not work if the parameter is so long.
In the backend:</p>
<pre><code>folderList.InnerHtml += "<span onclick='AttachId(" + folder.Id + ")'>" + folder.DisplayName + "</span>";
</code></pre>
<p>In the frontend:</p>
<pre><code>function AttachId(id) {
$("[id$='hf_FolderId']").val(id);
$("[id$='btn_Move']").click();
}
</code></pre>
<p>The parameter <code>folder.Id="AQMkAGQ2YzBkYjkxLWZjNTYtNDAwAS1hZWY2LWQ3OWI2MDkxZTE2ZAAuAAAD82EfyZcOUkeLGnLBkE1iOgEA04D3/FOc8ES6LdlZ5/AXHgAAAQRaEQAAAA=="</code></p>
<p>If I change it to "123" it works. Any idea?</p>
<p>Or maybe you could let me know a better way to pass parameter from back to front. Many thanks.</p>
| c# javascript asp.net | [0, 3, 9] |
4,847,624 | 4,847,625 | Prevent stacking of AJAX-requests | <p>I've got a problem which I can't seem to solve. </p>
<p>I'm currently implementing a an AJAX-function similar to the one Twitter uses - that fetch new posts on scrolling.</p>
<p>The jQuery looks something like this: </p>
<pre><code> $(window).scroll(function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$('div#ajaxloader').show();
$.ajax({
url: "loader.php?lastid=" + $(".container:last").attr("id"),
success: function(html){
if(html){
$("#main").append(html);
$('div#ajaxloader').hide();
}else{
$('div#ajaxloader').html('No more posts to show.');
}
}
});
}
});
</code></pre>
<p>Now the problem; if the user scrolls really fast and the database is doing it's work quickly - the jQuery doesn't seem to be able to send the correct id as a query fast enough - which results in double-posts. </p>
<p>Anyone have a good idea on how to prevent this?</p>
| php javascript jquery | [2, 3, 5] |
5,162,861 | 5,162,862 | Javascript forward backward buttons | <p>I'm using the s3Slider javascript slideshow on the homepage of a site I am developing:</p>
<p><a href="http://alexisparkinn.com/" rel="nofollow">http://alexisparkinn.com/</a></p>
<p>I really like this slideshow but it has no way to enable the user to go to the next or previous image.</p>
<p>How can I add these buttons? Does anybody know the necessary javascript code I need to use or what changes should be made.</p>
<p>Suggestions? Any help would be greatly appreciated.</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
800,539 | 800,540 | jQuery underscore notation | <p>Could anybody give me an explanation of the underscore in a jQuery plugin function? I have no idea of what "<em>_</em>" means. Example code below:</p>
<pre><code>$.fn.bgStretch=function(o){
this.each(function(){
var th=$(this),
data=th.data('bgStretch'),
_={
align:'leftTop',
altCSS:{},
css:{
leftTop:{
left:0,
right:'auto',
top:0,
bottom:'auto'
},
rightTop:{
left:'auto',
right:0,
top:0,
bottom:'auto'
},
leftBottom:{
left:0,
right:'auto',
top:'auto',
bottom:0
},
rightBottom:{
left:'auto',
right:0,
top:'auto',
bottom:0
}
},
preFu:function(){
_.img
.load(function(){
_.checkWidthFu()
_.img
</code></pre>
| javascript jquery | [3, 5] |
1,120,606 | 1,120,607 | Event to save data in ViewState before postback | <p>I am looking for an event firing before a DropdownList auto-postback to save Listbox items (populated with JS) in the ViewState.</p>
<p>I tried the <code>OnSelectedIndexChanged</code> event but it's fired too late.</p>
<p>Can this be done, and how?</p>
| c# asp.net | [0, 9] |
1,840,758 | 1,840,759 | tinyMCE Editor: unable to open Edit HTML Source Option | <p>I have integrated tinyMCE editor in my JSP page.All option of Editor are working except Edit Source Option.</p>
<p>I don't understand why it is not working.
Additionally,How to open any html page in tinyMCE editor.is there is any facilities provided to it or NOT?</p>
<p>i have imported all js files required for full functioning of tinyMCE Editor :
that includes:</p>
<pre><code>-classes
-langs
-plugins
-utils
-themes
-config.js
-tiny_mce.js
</code></pre>
<p>What is proper solution to enable Edit HTML Source option in Editor?</p>
| javascript jquery | [3, 5] |
3,869,878 | 3,869,879 | Popup window without address & menu bar on click of hyperlinkfield in gridview | <p>I am developing a screen in c# dot net where i have a search screen which contains a hyperlink field containing some querystring values, on clik of hyperlink field i have to open a pop up window which is working fine however i dont want adress bar or menu items to be displayed in pop up window also size should be specific, can anyone please tell me how to achive it.</p>
<p>I am using below code however its only changing size of window and not hiding menu etc moreover first pop up window gets loaded in full size and then gets changed to size i have specified.</p>
<pre><code><asp:HyperLinkField DataNavigateUrlFields="FileName" DataTextField="FileName"
Target="_blank" DataNavigateUrlFormatString="javascript:var NewWin=window.open
('abc.aspx?EMPId={0}',null,'width=800,height=200,top=100,left=100,scrollbars=no,
directories=no,status=no,toolbar=no,resizable=no');"HeaderText="EMPId">
</asp:HyperLinkField>
</code></pre>
<p>Also, i could use a linkbutton where this pop up window is working fine however i have a requirement of adding querystring in rowdatabound of grid to URL which gets fired on click on my linkbutton and pop up window gets open however i am not able to do so by using below code.</p>
<pre><code>protected void grdDisplayResult_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink hyperlink = (HyperLink)e.Row.Cells[2].Controls[0];
Label lblRowNumber = ((Label)e.Row.FindControl("lblRowNum"));
hyperlink.NavigateUrl += "&RowNum=" + lblRowNumber.Text;
}
}
</code></pre>
<p>if i get solution for any of them it would be of great help.</p>
| javascript asp.net | [3, 9] |
3,690,233 | 3,690,234 | How to find readonly textfields using jquery | <p>How can i find readonly textfields in a form..i treied this..but it is not working..</p>
<pre><code>$('input[readonly="readonly"]').each(function()
{
$(this).attr('tabindex', '-1');
}
</code></pre>
| javascript jquery | [3, 5] |
3,106,614 | 3,106,615 | Android: Unhandled exception type IOException Error | <p>I am total noob at Android dev. I am still learning, and I am on very first step of my app dev.</p>
<p>I have this code working and it runs fine or regular Java, now I am trying to implement to Android OS.</p>
<p>In my code where it says <code>TEST.openStream()</code> I get <code>Unhandled exception type IOException</code> error.</p>
<pre><code> package com.zv.android;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import android.app.Activity;
import android.os.Bundle;
public class ZipActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
URL TEST = new URL("http://www.google.com/");
BufferedReader in = new BufferedReader(new InputStreamReader(TEST.openStream()));
String inputLine;
int line=0;
while ((inputLine = in.readLine()) != null){
line++;
//System.out.println(line + "\t" + inputLine);
}
// in.close();
} catch(MalformedURLException e) {
//Do something with the exception.
}
}
}
</code></pre>
| java android | [1, 4] |
7,913 | 7,914 | How to remove a div if it contains a certain string in it? | <p>there's a list of items on a page, some blank, with one example being:</p>
<pre><code><div class="item itemask">
<div class="tophead">
<div class="itemnumber">30</div>
<a class="article" href=""></a>
</div>
<div class="bottomhead"> points by <a class="userlink" rel=""></a> ago&nbsp;&nbsp;&nbsp; <a href="/item?id=">discuss</a>
</div>
</code></pre>
<p></p>
<p>Hence, what jQuery or JavaScript could be used to find an instance of: <code><a class="article" href=""></code> in any instance of a <code>div class=item</code> on the page, and then delete or hide that individual parent <code>div</code> of <code>class=item</code> which contains that piece of code?</p>
| javascript jquery | [3, 5] |
1,332,427 | 1,332,428 | how to play a sound in asp.net web page? | <p>I want to play some sounds in my web page once I click a button .
this is my code but it shows an error.</p>
<pre><code>SoundPlayer x = new SoundPlayer();
x.SoundLocation = "WindowsBalloon.wav";
//x.Play();
x.PlaySync();
</code></pre>
<p>error: Please be sure a sound file exists at the specified location.</p>
<p>but the file exists in my project .and I'm sure that the address is correct.</p>
| c# asp.net | [0, 9] |
4,965,227 | 4,965,228 | how to call an ASP.NET c# method using javascript | <p>Does anyone know how to call a server-side c# method using javascript? What i need to do is to stop imports if Cancel is chosen or to continue importing if ok is chosen. I am using visual studio 2010 and c# as my programming lanaguage</p>
<p>This is my code:</p>
<pre><code>private void AlertWithConfirmation()
{
Response.Write(
"<script type=\"text/javascript\">" +
"if (window.confirm('Import is currently in progress. Do you want to continue with importation? If yes choose OK, If no choose CANCEL')) {" +
"window.alert('Imports have been cancelled!');" +
"} else {" +
"window.alert('Imports are still in progress');" +
"}" +
"</script>");
}
</code></pre>
| c# javascript asp.net | [0, 3, 9] |
4,843,233 | 4,843,234 | finding all the HtmlInputCheckBox controls with master.pages with recursion | <p>I thought this would work. But it's not working. It's never getting inside of if (c is HtmlInputCheckBox)</p>
<pre><code>private string GetAllCheckBoxes(ControlCollection controls)
{
StringBuilder sb = new StringBuilder();
foreach (Control c in controls)
{
if (c.HasControls())
{
GetAllCheckBoxes(c.Controls);
}
else
{
if (c is HtmlInputCheckBox)
{
CheckBox cb = c as CheckBox;
if (cb.Checked)
{
sb.Append(cb.ID + "_1");
}
else
{
sb.Append(cb.ID + "_0");
}
}
}
}
return sb.ToString();
}
</code></pre>
<p>update: c is throwing somesort of error. </p>
<pre><code>Parent = {InnerText = '((System.Web.UI.HtmlControls.HtmlContainerControl)(((System.Web.UI.HtmlControls.HtmlGenericControl)(c.Parent)))).InnerText' threw an exception of type 'System.Web.HttpException'}
</code></pre>
| c# asp.net | [0, 9] |
1,992,013 | 1,992,014 | Posting information and retrieving results using Ajax | <p>I would like to using (Ajax) PHP or Javascript, Post information to <a href="http://en.lernu.net/cgi-bin/vortaro.pl" rel="nofollow">http://en.lernu.net/cgi-bin/vortaro.pl</a> then read the results back (Not from lernu.net).</p>
<p>I am trying to learn Ajax, PHP + Javascript, Nobody there know's how to help me. I would very much like doing this without touching Lernu's code, So if there is a way to do it all on my code, that would be great!</p>
| php javascript | [2, 3] |
4,439,777 | 4,439,778 | Closing a tab after server side script has executed | <p>I need a little assistance. I want to close a firefox tab after a classic asp script has executed which is run at specific times of the day automatically.</p>
<p>I have tried the following code without success:</p>
<pre><code><% ASP SCRIPT %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript">
window.onload = function(){window.close();}
</script>
</head>
</html>
</code></pre>
<p>Any ideas how this can be accomplished? Any help would be greatly appreciated.</p>
<p>Many thanks, neojakey</p>
| javascript jquery | [3, 5] |
801,490 | 801,491 | How to detect Ctrl + Mouse dblckick using jquery | <p>I want to detect event like <code>Ctrl + DblClick</code> using jQuery. For <code>dblclick</code> I already have dblclick event. Is it possible to recognize the event without setting flag on keypress event?</p>
| javascript jquery | [3, 5] |
4,311,402 | 4,311,403 | btnAdd_Click fires when i press F5 | <p>Hi I've a simple code to insert data into db in button click event. It is executing fine and insert data into db. After inserting data if i press f5 button it is again inserting a new row into db with the same values.</p>
<p>Button click event fires on each f5 button (refresh)</p>
<p>Wat is the problem?</p>
<p>Thank you,
Nagu</p>
| c# asp.net | [0, 9] |
4,375,088 | 4,375,089 | what is '.tipN' sign in knockout js? | <pre><code>var InitTipsy = function () { $('.tipN').tipsy({ gravity: 'n', fade: true });}
</code></pre>
<p>What is the meaning of <code>'.sign'</code>?</p>
| javascript jquery asp.net | [3, 5, 9] |
5,099,948 | 5,099,949 | Java vs C# - AddActionListener vs event subscription | <p>Very simple question from one somewhat new to Java: when adding an event handler (or whatever it is called in Java) to a Control, MUST it be an object? I mean, in C# I can do </p>
<pre><code>control.event += System.eventHandler(methodThatHandlesEvent)
</code></pre>
<p>Sure, that's because we have delegate types in C#, but I was wondering if I can choose which method would be called when an event is raised in Java? I mean, in Java I can have something like:</p>
<pre><code>control.AddActionListener(objectWhichClassImplementsActionListener)
</code></pre>
<p>And then I have the <code>actionPerformed</code> method in this class, which is the only method that is called. I know there are more kinds of listeners, but I can't have a "ActionListenerHandler" class in which I implement several <code>actionPerformed</code> methods that can be assigned to different controls?</p>
| c# java | [0, 1] |
5,603,530 | 5,603,531 | Javascript code to read java variable value | <ul>
<li>I have a session variable in java file.(TestConnection.java)</li>
</ul>
<blockquote>
<p>session.setAttribute("CONNECTION_DBNAME", dbName);</p>
</blockquote>
<ul>
<li>How to read CONNECTION_DBNAME value into javascript file.(utility.js)</li>
</ul>
| java javascript | [1, 3] |
2,774,624 | 2,774,625 | fields not allowed in C# interface | <p>There are quite a lot of deviations in Java and C# languages, one of which I observed was we cannot add variable constants in an interface. Being from Java background I got baffled to see compilation error when I tried this.</p>
<p>Does anyone has explanation why it is so?</p>
| c# java | [0, 1] |
4,602,315 | 4,602,316 | Accessing 2 values from jquery and setiing those values to different variable | <p>using html,jquery,and jsp
using autocomplete am fecting name from my database using jsp and jquery,
input in textbox t1: if i press A it will fetch all the data starts from A from my database and displays in drop down
through this function am sending my input to jsp </p>
<pre><code><script>
jQuery(function(){
$("#empName").autocomplete("list.jsp");
});
</script>
</code></pre>
<p>i can able to set only empname value in my html inputbox through that function, my requirement is to set employeename in textbox t1 and employee id in textbox t2, </p>
<p><strong>in jsp</strong> </p>
<pre><code>String strAssigneeName = rs.getString("em_first_name")+" ID "+rs.getString("em_emp_id");
if(strAssigneeName.toLowerCase().startsWith((suggetsword)))
{
%>
<%=strAssigneeName%>
<%
</code></pre>
<p>this is working fine it is able to fetch employee name as well as employee id, but while displaying both value is coming in single textbox t1,
how can i access this two values in two different text boxs using jquery</p>
| javascript jquery | [3, 5] |
4,639,776 | 4,639,777 | Scrolling a Page after Validation showing Validation Pop Up | <p>i have a button on the bottom of the page OnClick it validates the form fields and if there is no valid field it displays a pop up message to enter the required fields using asp.net Validation Summary Control.
I want that when it showing the pop up once user click on OK buttom of pop up window then it should scroll to top of the page to form area.
Does any one have idea how to handle this to jump the page up?
I am working in asp.net 3.5 +VS 2010.
Thanks </p>
| javascript jquery asp.net | [3, 5, 9] |
2,114,458 | 2,114,459 | jquery selector on some element | <p>I have a an element as shown below:</p>
<pre><code> <tr id="test1" class="class-of-part1">
<td>...</td>
</tr>
</code></pre>
<p>I have to select the the element with id 'test1' and class which begin with 'class-of'. how to select with jquery selector? </p>
| javascript jquery | [3, 5] |
1,486,987 | 1,486,988 | Can I redirect the Admin->abc.aspx to rootfolder->index.aspx using javascript? | <p>Just explaining my question in short.</p>
<p>I have asp.net website with root structure as following</p>
<pre><code>root Directory->
Admin
abc.aspx
xyz.aspx
index.aspx
</code></pre>
<p>Now I want to redirect from <code>abc.aspx</code> to <code>index.aspx</code>.</p>
<p>I'm using JavaScript as </p>
<pre><code>window.location = "../index.aspx";
</code></pre>
<p>but found no any luck.</p>
| javascript asp.net | [3, 9] |
666,096 | 666,097 | if the IF statement is true view new activity | <pre><code> if(res.equals("5510"))
checkback.setText("Correct version");
//
else
checkback.setText("Incorrect version, please update. \n Your current version is " + getString(R.string.versioncode));
</code></pre>
<p>How do i get it so that if the IF statement is true then it'll start and view mainactivity.class?</p>
<p>I put intent in but when i did it showed up with a bunch of errors</p>
| java android | [1, 4] |
1,346,284 | 1,346,285 | Double-tap behaviour in android stock browser | <p>I have a page here: </p>
<p><a href="http://lonbus.net" rel="nofollow">http://lonbus.net</a></p>
<p>That I have disabled double-tap zoom on mobile browsers via the inclusdion of the line: </p>
<pre><code><meta name="viewport" content="width=device-width, user-scalable=no" />
</code></pre>
<p>This was done since when pressing buttons on the page it was easy to accidentally trigger a double-tap zoom. </p>
<p>This works. However, on the galaxy s2 phone (maybe others) double-tapping now seems to shift the whole page up or two the left, revealing white bars to the side of the page. Any thoughts as to why this happens...and if there is a way to capture the doubletap event completely and ignore it within the browser? </p>
<p>Research so-far suggests no</p>
| javascript android | [3, 4] |
42,577 | 42,578 | Minimalizing namespaces for custom functions | <p>I have a StringUtilities.cs file in the CommonFunctions Project that holds a UppercaseFirst function that Uppercases the first word in a string. Currently in the .aspx.cs in a separate Project (in the same Solution) that is utilizing this function is called using <strong>MyProject.CommonFunctions.StringUtilities.UppercaseFirst("hello world");</strong></p>
<p>Is it possible to shorten it to just <strong>UppercaseFirst("hello world");</strong> ? Readability will be so much better.</p>
<p>StringUtilities.cs in the CommonFunctions Project:</p>
<pre><code>namespace MyProject.CommonFunctions
{
public class StringUtilities
{
public static string UppercaseFirst(string s)
{//blah code}
}
}
</code></pre>
<p>Default.aspx.cs</p>
<pre><code>using MyProject.CommonFunctions;
...
protected void Page_Load(object sender, EventArgs e)
{
MyProject.CommonFunctions.StringUtilities.UppercaseFirst("hello world");
}
</code></pre>
| c# asp.net | [0, 9] |
1,443,947 | 1,443,948 | How i can i delete a selected item out of a listbox using php,javascript? | <p>I got 2 buttons. One is to add an item to the listbox. The other is to delete something out of the listbox. The filling happens with an array.
So what I need to know is: how can i delete a selected item out of the listbox?</p>
<p>Thanks
Stijn</p>
| php javascript | [2, 3] |
899,784 | 899,785 | jquery ajax file upload , parameters to be sent | <pre><code><form action="upload_file.php" method="post" enctype="multipart/form-data">
</code></pre>
<p>Above is the line for a form to upload a file using php.</p>
<p>If i use the form as I wrote above I can get the various properties of the file to be uploaded from upload_file.php page. </p>
<p>Using jquery $.post , how can I do the same thing in upload_file.php ? </p>
<p>I googled but can't find the exact snippet of code necessary here.</p>
| php jquery | [2, 5] |
1,648,234 | 1,648,235 | Issue's containing, "onClick" and a getIntExtra | <p>I am having issues getting this to work, here is what I am trying to get to: an onClickListener that will get the state of the radio and return a toast. But I am messing up somewhere. I am having an issue with the intent, anyone able to shed some light on this?the intent is not able to be resolved. (Yes, I obviously have imported it.) Here is what I have:</p>
<pre><code>public class MainActivity extends Activity {
protected Intent intent;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button check = (Button)findViewById(R.id.Button01);
check.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v){
getIntent();
int state= intent.getIntExtra(TelephonyManager.EXTRA_STATE, -1);
String msg=null;
switch (state) {
case TelephonyManager.NETWORK_TYPE_1xRTT:
Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show();
break;
}
}
});
}
</code></pre>
<p>}</p>
| java android | [1, 4] |
3,501,095 | 3,501,096 | parsingproblem in android saxparsing | <pre><code>@Override
public void characters(char ch[], int start, int length)
throws SAXException {
super.characters(ch, start, length);
String strCharacters = new String(ch,start,length);
if (itemFound==true){
// "item" tag found, it's item's parameter
switch(currentState){
case state_title:
item.setTitle(strCharacters);
break;
case state_description:
item.setDescription(strCharacters);
break;
case state_link:
item.setLink(strCharacters);
break;
case state_pubdate:
item.setPubdate(strCharacters);
break;
default:
break;
}
} else {
// not "item" tag found, it's feed's parameter
switch(currentState){
case state_title:
feed.setTitle(strCharacters);
break;
case state_description:
feed.setDescription(strCharacters);
break;
case state_link:
feed.setLink(strCharacters);
break;
case state_pubdate:
feed.setPubdate(strCharacters);
break;
default:
break;
}
}
currentState = state_unknown;
}
</code></pre>
<p>Please tell me how to parse (&) I am not able to parse & in this</p>
| java android | [1, 4] |
1,428,663 | 1,428,664 | how to check html tags and the replace content between those tags? | <p>Here is my code: <a href="http://jsfiddle.net/zEXrq/8/" rel="nofollow">http://jsfiddle.net/zEXrq/8/</a></p>
<p>Also I need to check <code><li></code> tag and <code><h3></code> tags.</p>
<p>Is it possible to check other words into those tags like <code><a onclick="word_desc(23); classChange(1, 1);" id="txtid1" class="sel25">user key</a></code> - here I want to replace only "user key", but when I put "a" to replace all "a" words including <code><a></code> tag and other words inside tags are replaced. How to solve this?</p>
| php javascript | [2, 3] |
5,899,763 | 5,899,764 | Changing the behavior of a button depending on whether an activity is launched | <p>I have a transparent activity that gets launched on top of another activity. For the purposes of clarity, lets say that the transparent activity is called CommentsView, which is launched from an activity called ArticleView. </p>
<p>At the bottom of the ArticleView activity is a button that launches the CommentsView activity on top of it. While the CommentsView activity is launched, I would like to change the functionality of that button so that, when clicked again, it cancels the CommentsView activity and returns to ArticleView. </p>
<p>How can I go about doing this. I've tried adding a new onclicklistener to that button within the CommentsView activity, but I get a <code>NullPointerException</code> (presumably because that button doesn't exist in that activity). I've also tried handling this within the ArticleView activity, by creating a boolean variable <code>commentsLaunched</code> and using an if statement to either launch CommentsView (if <code>commentsLaunched == false</code>) or cancel it (if <code>commentsLaunched == true</code>). However, when I try this method I get a compiler error: <code>The final local variable commentClicked cannot be assigned, since it is defined in an enclosing type</code>. I can't define the commentClicked variable within the listener, or it will get re-initialized each click and thus be worthless.</p>
<p>How can I go about achieving my goal?</p>
| java android | [1, 4] |
3,716,896 | 3,716,897 | Too many jquery plugins? | <p>I'm developing a website, but I realized that, in addition to the link to my main javascript file, and the link to the jquery file, it's beginning to look like I'm going to have links to three or more plugins also.
I'm just wondering if this is good practice? The site I'm building is a web app, so I need a lot of functionality, but I don't want to be a plugin glutton. Is it considered good to append all the javascript plugins together into one file so as to only have to download one file, or will I run into problems? </p>
| javascript jquery | [3, 5] |
916,044 | 916,045 | Problem when I place javascript in $(document).ready | <p>Hi I am having following code working fine when placed without $(document).ready </p>
<pre><code> <asp:TextBox ID="TextBox_FirstName" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox_LastName" runat="server"></asp:TextBox>
<asp:Button ID="txtSubmit" Text="Validate" runat="server" />
<asp:CustomValidator ID="AtLeastOneTextBoxValidator" runat="server"
ClientValidationFunction="Validate_Textbox" ValidateEmptyText="true">
</asp:CustomValidator>
function Validate_Textbox(sender, args) {
var firstName = document.getElementById("<%= TextBox_FirstName.ClientID %>");
var lastName= document.getElementById("<%= TextBox_LastName.ClientID%>");
if ((firstName == "") && (lastName == "")){
window.alert("Error");
}
}
</code></pre>
<p>When I placed this code inside $(document).ready it is giving '<strong>Microsoft JScript runtime error: Object expected'</strong> error.</p>
<pre><code>$(document).ready( function(){
function Validate_Textbox(sender, args) {
var firstName = document.getElementById("<%= TextBox_FirstName.ClientID %>");
var lastName = document.getElementById("<%= TextBox_LastName.ClientID%>");
if ((firstName == "") && (lastName == "")){
window.alert("Error");
}
}
});
</code></pre>
| javascript jquery | [3, 5] |
4,642,338 | 4,642,339 | Request.UrlReferrer is null when redirected to that particular .aspx page | <p>After approve the customer I want to redirect to Admin_View_Customers.aspx page. For that purpose i wrote the following code. </p>
<p>ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('The selected user has been Approved successfully.');location.href = 'Admin_View_Customers.aspx';", true);</p>
<p>But in the page load event of Admin_View_Customers.aspx i have wrote a code :</p>
<pre><code>if (Request.UrlReferrer == null)
{
Response.Redirect("AccessDenied.aspx");
}
</code></pre>
<p>in order to avoid access to this page by copy the url and paste it in another browser or another tab.My problem is that I got the message <strong><em>The selected user has been Approved successfully.</em></strong> but it is redirected to AccessDenied.aspx NOT to the Admin_View_Customers.aspx.
I am using ASP.NET with C#
Any Help will be appreciated</p>
| c# asp.net | [0, 9] |
2,766,889 | 2,766,890 | .load() jQuery with div selector causing <script> to be overlooked | <p>so I am trying to load in content with ajax jQuery and here is my script:</p>
<pre><code>$('#ajaxloadcontent').load(url+' #ajaxloadcontent');
</code></pre>
<p>I've done some research and learned that when a specific selector is used for a .load() function, #ajaxloadcontent, that s on that page that is being loaded in are overlooked. I have tried everything to try and fix this error and have been browsing the StackOverflow community for hours, with no success. Obviously, I need my script to be able to recognize as it is a vital part to my site. Any help would be greatly appreciated as I can not continue the development of my site until I get this issue fixed. Thanks.</p>
| javascript jquery | [3, 5] |
192,527 | 192,528 | how to get HiddenField Value from ascx.cs page to aspx.cs page | <p>my ascx code:</p>
<pre><code><%@ Control Language="C#" AutoEventWireup="true" CodeFile="Demo.ascx.cs" Inherits="Demo" %>
<asp:HiddenField ID="hidden1" runat="server" Value=""/>
<asp:Label ID="lbl1" runat="server" Text="Hiii"></asp:Label>
</code></pre>
<p>my ascx.cs code :</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lbl1.Text = "Mahendra Kamble";
hidden1.Value = "123";
}
}
</code></pre>
<p>my aspx code: </p>
<pre><code><%@ Register TagName="TopBar" TagPrefix="CRS" Src="~/Demo.ascx" %>
---
--
<div>
<CRS:TopBar ID="Hide" runat="server" Visible="false"/>
</div>
</code></pre>
<p>my aspx.cs code </p>
<pre><code> if (!IsPostBack)
{
//Label lb = (Label)Hide.FindControl("lbl1");
// Response.Write("---" + lb.Text);
//HiddenField hf = (HiddenField)Hide.FindControl("hidden1");
//Response.Write("---" + hf.Value);
// UserControl control = (UserControl)LoadControl("Demo.ascx");
Demo uc = (Demo)Page.LoadControl("Demo.ascx");
// HiddenField hf1 = (HiddenField)control.FindControl("hidden1");
HiddenField hide = (HiddenField)uc.FindControl("hidden1");
Response.Write("--- " + hide.Value + " Value ");
form1.Controls.Add(uc);
}
</code></pre>
<p>Now How should I get the Value of HiddenField i.e. hidden1.value="123" in this aspx.cs page?</p>
| c# asp.net | [0, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.