Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
5,246,042 | 5,246,043 |
Message box run behind the browser
|
<p>I have a pop out message box, what I want is the message box always pop out in front of the browser when it is clicked, but the problem is it sometimes pop out behind the browser.
Anything I can do to make sure the message box is always pop out in front the browser?
Thanks.</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
string appointmentdate = Convert.ToString(DropDownListDay.Text + "-" + DropDownListMonth.Text + "-" + DropDownListYear.Text);
string appointmenttime = Convert.ToString(DropDownListTime.Text);
using (SqlConnection con = new SqlConnection("Data Source=USER-PC;Initial Catalog=webservice_database;Integrated Security=True"))
{
con.Open();
SqlCommand data = new SqlCommand("Select COUNT(*) from customer_registration where adate='" + appointmentdate + "'AND atime='" + appointmenttime + "'", con);
Int32 count = (Int32)data.ExecuteScalar();
if (count == 0)
{
SqlConnection con1 = new SqlConnection("Data Source=USER-PC;Initial Catalog=webservice_database;Integrated Security=True");
SqlCommand cmd = new SqlCommand("UPDATE customer_registration SET servicetype = @servicetype, comment = @comment, adate = @adate, atime = @atime where username='" + Session["username"] + "'", con1);
con1.Open();
cmd.Parameters.AddWithValue("@servicetype", DropDownListServicetype.Text);
cmd.Parameters.AddWithValue("@comment", TextBoxComment.Text);
cmd.Parameters.AddWithValue("@adate", DropDownListDay.Text + "-" + DropDownListMonth.Text + "-" + DropDownListYear.Text);
cmd.Parameters.AddWithValue("@atime", DropDownListTime.Text);
cmd.ExecuteNonQuery();
con1.Close();
Response.Redirect("MakeAppointmentSuccess.aspx");
}
else
{
MessageBox.Show("This appointment is not available. Please choose other date & time.");
con.Close();
}
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
424,279 | 424,280 |
How to submit a form on enter that doesn't have a submit button?
|
<p>I have a form whose submit "button" is actually a link. Is there a way to submit this form automatically on enter, other than attaching an event handler to check for Enter keypresses? It just seems a little wasteful to me.</p>
|
javascript jquery
|
[3, 5]
|
1,210,811 | 1,210,812 |
How to add a html <a> tag with javascript or jquery?
|
<p>I've done a slideshow for news on a website which works with jquery. Everything works perfectly except for a line where I try to add a link which links the complete version of the news. But Javascript never adds the tag nor show an error on the console.
Here's the function which changes the currently displayed news on the slideshow :
<code><pre>
function changeNews(newCurrentNewsNumber)
{
var realNewsNumber = newCurrentNewsNumber - 1;
$("#number" + currentNewsNumber).css("color", "#FFFFFF");
$("#number" + currentNewsNumber).css("backgroundColor", "#474747");
$("#imageNews").attr("src").replace(newsImagePathArray[newCurrentNewsNumber - 1]);
$("#number" + newCurrentNewsNumber).css("color", "#055c94");
$("#number" + newCurrentNewsNumber).css("backgroundColor", "#FFFFFF");
$("#textNews").html(newsTitleArray[realNewsNumber]+"<br />" + newsTextArray[realNewsNumber]+"<br />");
<b>$("#textNews").append("<a href=\"index.php?corps=news&id="+realNewsNumber+">Voir la suite de la news...</a>");</b>
currentNewsNumber = newCurrentNewsNumber;
}
</pre></code></p>
<p>newCurrentNewsNumber is the new news to display. currentNewsNumber is the old one. newsXXXArray contains elements of the news.
The line in blod is the one which doesn't do what it should. Any help would appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,499,129 | 5,499,130 |
javascript: Even after returning false, click event triggers default action: takes to the top of the page
|
<p>I have a script which involves a click function and it always takes me to top of the page. I tried returning false as well as event.preventDefault() function but none seem to work. Here is my code: <a href="http://jsfiddle.net/79Rzh/14/" rel="nofollow">http://jsfiddle.net/79Rzh/14/</a></p>
<p>Please help.</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
5,516,152 | 5,516,153 |
Select table rows between 2 rows
|
<p>Quick js\jquery question.</p>
<p>I have a table like this:</p>
<pre><code><table id="test">
<tr class="divider"><td>Set 1</td></tr>
<tr><td>Row 1</td></tr>
<tr><td>Row 2</td></tr>
<tr><td>Row 3</td></tr>
<tr class="divider"><td>Set 2</td></tr>
<tr><td>Row 4</td></tr>
<tr><td>Row 5</td></tr>
<tr><td>Row 6</td></tr>
<tr class="divider"><td>Set 3</td></tr>
<tr><td>Row 7</td></tr>
<tr><td>Row 8</td></tr>
<tr><td>Row 9</td></tr>
</table>
</code></pre>
<p>I want to select only the 3 rows between the rows with the class "divider".</p>
<p>I started a jsfiddle here: <a href="http://jsfiddle.net/ZQhBP/1/" rel="nofollow">http://jsfiddle.net/ZQhBP/1/</a></p>
<p>I am using nextUntil but it doesn't seem to be working right</p>
<p>Thanks for any help.</p>
|
javascript jquery
|
[3, 5]
|
1,476,171 | 1,476,172 |
What is the purpose of `convertView` in ListView adapter?
|
<p>In android, I usually use <code>MyAdapter extends ArrayAdapter</code> to create view for the <code>ListView</code>, and as a result, I have to override the function </p>
<pre><code>public View getView(int position, View convertView, ViewGroup parent) {
// somecode here
}
</code></pre>
<p>However, i don't know exactly what <code>convertView</code> and <code>parent</code> do! Does anyone have a suggestion? More detail, more help! Thanks!</p>
|
java android
|
[1, 4]
|
3,842,784 | 3,842,785 |
How to reference a div using id contained in another element?
|
<p>I have an alphabetical index that when clicked unhides a div that contains it's content.</p>
<p>Here is the HTML so I can explain properly:</p>
<pre><code><ul class="index">
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
<div id="index-A" class="hide">A contents</div>
<div id="index-B" class="hide">B contents</div>
<div id="index-C" class="hide">C contents</div>
</code></pre>
<p><strong>When a letter is clicked, I want to unhide it's content div and also hide any other ones that are visible.</strong></p>
<p>How could I do that?</p>
<p>Here is what I have been trying, but am stuck at this point:</p>
<pre><code>$('.index li').click(function(e) {
// somehow reference the content div using: "index-" + $(this).text()
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,039,239 | 4,039,240 |
null reference with and if statement c#
|
<p>I am just want to check for empty text boxes and change the text the boxes if they are null in RowEditing event. I just can't figure this out. Of course the some of the boxes will be empty when the Grid is populated. The other question is am I placing this in the right event? </p>
<p>Here is the row editing event :</p>
<pre><code>protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
fill_grid();
//Set the edit index.
GridView1.EditIndex = e.NewEditIndex;
//Bind data to the GridView control.
check_grid_boxes();
GridView1.DataBind();
}
</code></pre>
<p>Here is the check_grid_boxes Method : </p>
<pre><code>protected void check_grid_boxes()
{
if (gtxtLane.Text == "")
{
gtxtLane.Text = "0";
}
else if (gtxtCarriers.Text == "")
{
gtxtCarriers.Text = "0";
}
else if (gtxtREV.Text == "")
{
gtxtREV.Text = "0";
}
return;
}
</code></pre>
<p>Before you mention Java Script or Jquery. This is a web control and my attempts at using java has not worked. </p>
<p>I changed my code to this : </p>
<pre><code> protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
fill_grid();
GridView1.EditIndex = e.NewEditIndex;
var lane = (TextBox)GridView1.Rows[e.NewEditIndex].FindControl("gtxtLane");
var car = (TextBox)GridView1.Rows[e.NewEditIndex].FindControl("gtxtCarriers");
var badcar = (TextBox)GridView1.Rows[e.NewEditIndex].FindControl("gtxtBadCarriers");
if (String.IsNullOrEmpty(lane.Text))
{
lane.Text = "0";
}
else if (String.IsNullOrEmpty(badcar.Text))
{
badcar.Text = "0";
}
else if (String.IsNullOrEmpty(car.Text))
{
car.Text = "0";
}
GridView1.DataBind();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,033,956 | 4,033,957 |
jQuery selector path bug on IE8
|
<p>On IE8, jQuery version 1.4.2 return 0(when length is checked) for the following selector path but with version 1.9.1 it returns 1.</p>
<pre><code>selectorPath = 'DIV#header + DIV > TABLE:first-child > TBODY:first-child >
TR:first-child > TD:first-child > TABLE:first-child >
TBODY:first-child > TR:first-child > TD:first-child >
TABLE:first-child > TBODY:first-child > TR:first-child >
TD:first-child > DIV:first-child + P + P + P + P + P + P
+ P + P + P + P + P + P + P + P + P + P + P + P + P + P +
P + P + P + P + P + P + P + P + P + P + P + P + P + P + P
+ P + P + P + P + P + P + H2 + P + P + P + P + P + P + P +
P + P';
$_1_4_2(selectorPath).length //returns 0
$_1_9_1(seelctorPath).length //returns 1
</code></pre>
<p>Can someone point me to the exact bug which covers this issue, or atleast a list of possibly related selector path bugs on version 1.4.2</p>
|
javascript jquery
|
[3, 5]
|
1,115,755 | 1,115,756 |
android-java: check boolean value checking for null
|
<p>I am trying for null check like below </p>
<pre><code>if (isTrue == null)
</code></pre>
<p>compile error says : "The operator == is undefined for the argument type(s) boolean"</p>
<p>Please help, how to do null check.</p>
<p>Thanks </p>
|
java android
|
[1, 4]
|
1,929,994 | 1,929,995 |
C#|Working with process help
|
<p>a few days ago i started working with process, i did a few things.. and wanted to ask a question. </p>
<p>lets say i got a process :</p>
<pre><code>process = Process.Start("D:\\Server1\\orangebox\\srcds.exe", "srcds.exe -console -game cstrike +maxplayers 16 -port 27017 +map de_dust2");
process.EnableRaisingEvents = true;
process.Exited += new EventHandler(process_Exited);
}
void process_Exited(object sender, EventArgs e)
{
process = Process.Start("D:\\Server1\\orangebox\\srcds.exe", "srcds.exe -console -game cstrike +maxplayers 16 -port 27017 +map de_dust2");
process.EnableRaisingEvents = true;
process.Exited += new EventHandler(process_Exited);
</code></pre>
<p>so, its works perfect. but, how can i do new process? but. added them from a button and the info of them comes from a textbox. </p>
<p>lets say i got <code>button1</code> and 3 <code>textbox</code>. 1 of the <code>textboxs</code> give me the process name, 1 the args, and 1 if to run now ot not. </p>
<p>so how can i do that? </p>
<p>thanks!!</p>
|
c# asp.net
|
[0, 9]
|
1,877,570 | 1,877,571 |
response.end method causing session variable to expire
|
<p>I am storing the returned sql resultant rows in a session variable ... so that I need not to query again and again</p>
<pre><code>Session["ds"] = datasetname;
</code></pre>
<p>Everything is fine but when I am doing export to excel ... where at last after the export is completed I am calling the method in try/catch</p>
<pre><code>try {
Response.End()
}
catch {}
</code></pre>
<p>But due to this, my session variable (ds) is getting expired and when I am using it next there is no rows and hence my page displays no data.</p>
<p>I tried going through internet and found that this is a bug it seems as identified by Microsoft and they have provided a hotfix for this but in Windows Vista .... I am running on XP.</p>
<p><a href="http://support.microsoft.com/kb/935778" rel="nofollow">http://support.microsoft.com/kb/935778</a></p>
<p>Is there any other workaround to this problem? Please let me know.</p>
<p>Thanks,
Rahul </p>
|
c# asp.net
|
[0, 9]
|
5,894,314 | 5,894,315 |
stats is not defined
|
<p>This code load the content of the php file with the parameter: online and name and print them dynamic every 0.2s, the whole code works, but it says that " stats " is not defined in internet explore, i dont know why. Help me out guys</p>
<pre><code>function updateStats(stat)
{
var stat = ["online","name"];
var stats = "";
if (stat==undefined)
{
document.write("is undefined");
}
var url = "online.php";
$.each(stat, function(i, key){
$.post(url, {stats: key}, function(data) {
$("#" + key).html(data);
});
});
}
setInterval('updateStats("updateStats")', 200); // 200 milliseconds = 0.2 seconds
</code></pre>
<p><strong>this is the updated code, but still says that stats not defined</strong> </p>
<pre><code>function updateStats(stat)
{
var stat = ["online","money"];
if (typeof stat == "undefined")
{
document.write("stat is undefined");
}
var url = "online.php";
$.each(stat, function(i, key){
$.post(url, {stats: key}, function(data) { // stats to stat
$("#" + key).html(data);
});
});
}
setInterval(function(){
updateStats("updateStats");
}, 1000);
if (typeof stats == "undefined")
{
document.write("stats is undefined");
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
345,388 | 345,389 |
check for at least 2 char sequence before whitespace in javascript / jQuery
|
<p>Well like the title says, how can i check it?
i have started something like this:</p>
<pre><code> for (var i = 0; i < elm.val().length; i++) {
if (elmVal.charAt(i) !== '') {
//do something
}
}
</code></pre>
<p>For example:</p>
<p>if the string is: "g g g" OR "gg g " it should be illegal.</p>
|
javascript jquery
|
[3, 5]
|
2,221,458 | 2,221,459 |
How to make a confirm box in asp .net using c#
|
<p>I want to show a confirmation box from c# code rather than JavaScript.
Is there any way I can have the confirmation box pop up when the below condition is true?</p>
<p>Here is the code so far:</p>
<pre><code>if (items.SelectedNode.ChildNodes.Count >= 1)
{
ScriptManager.RegisterStartupScript(this.nav_tree_items, typeof(string), "Alert", "alert('Hello');", true);
}
</code></pre>
<p>I have already tried add.attributes, but that does not work. </p>
<p>I also tried the following but on click of cancel it performs an action anyway:</p>
<pre><code>if (items.SelectedNode.ChildNodes.Count >= 1)
{
ScriptManager.RegisterStartupScript(this.nav_tree_items, typeof(string), "Confirm", "Confirm('Hello');", true);
}
</code></pre>
<p>Please help.</p>
|
c# asp.net
|
[0, 9]
|
225,920 | 225,921 |
jquery (javascript) refresh div
|
<p>Bear with me. I recently started implementing jquery at work. I created a new app already so I do have an understanding of what goes but I have not fully grasped it yet.</p>
<p>I have this function below that is being called everytime someone clicks a checkbox in a table wrapped in a unique div id. Currently, the table does not refresh until you close the dialog box. I want the div to refresh after the the server finishes its request.</p>
<p>I got it to work only for the first row in the table by simply calling the displayMid function again (that is commented out in the code below).</p>
<p>How do I get this to work for all the table rows? You can see I have been trying a few things already. ;-)</p>
<p>Any help is appreciated! Thanks!</p>
<pre><code>function addRemoveMid(count, testpid) {
var x = testpid;
var y = $("#Mid" + count).text();
var a = $("#midcheckbox" + count).is(':checked');
//alert(x);
if (!$("#midcheckbox" + count).is(':checked')) {
$.ajax({
url: "content_backend_pub_pid.ashx",
data: { cmd: '10', pid: x, mid: y },
type: "get",
async: false,
success: function(o) {
//displayMid(count);
//$("#inputDiv4").replaceWith($('#inputDiv4', $(html)));
}
});
//$(this.addRemoveMid(count);
}
else {
$.ajax({
url: "content_backend_pub_pid.ashx",
data: { cmd: '9', pid: x, mid: y },
type: "get",
async: false,
success: function(o) {
//displayMid(count);
//$("#inputDiv4").replaceWith($('#inputDiv4', $(html)));
}
});
//displayMid(count);
}
//$("#inputDiv4").fadeOut("fast").html('reload.php').fadeIn("fast");
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,465,797 | 2,465,798 |
Get value from GridView when a button is clicked
|
<p>I have a GridView , and the GridView has an item template. Now I need to get the value of the first cell which contains the value I need but I have tried the following and does not work, it eturns a ""</p>
<pre><code> int id = Convert.ToInt32(GridView.Rows[index].Cells[0].Text);
</code></pre>
<p>Here is the code I have in the gridview</p>
<pre><code><Columns>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:Label runat="server" ID="lblDepartmentID" Text='<%#DataBinder.Eval(Container.DataItem,"DepartmentID")%>' />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
</code></pre>
<p>I have to emphazise that I do not want to use the GridView_RowCommand or other GridView events.. I need to pull this value upon clicking a button on the same page.</p>
<p>How can I do this?</p>
|
c# asp.net
|
[0, 9]
|
532,036 | 532,037 |
jQuery (JavaScript) 3 > 10 = true
|
<p>There seems to be some stripping issue with jQuery when retrieving integer values from input values.</p>
<p>My code:</p>
<pre><code> // Control the rating input field to only accept numeric values
// -else set the values back to 0
// For the highest value:
$('.dsListItem .firstItem').keyup(function(){
if (isNumber($(this).val()) && $(this).val() < $('.dsListItem .lastItem').val()) {
console.log('FIRST: ' + $(this).val() + ' >>> ' + $('.dsListItem .lastItem').val());
$(this).val($('.dsListItem .lastItem').val());
}
});
// For the lowest value:
$('.dsListItem .lastItem').keyup(function(){
if (isNumber($(this).val()) && $(this).val() > $('.dsListItem .firstItem').val()) {
console.log('LAST: ' + $(this).val() + ' >>> ' + $('.dsListItem .firstItem').val());
$(this).val($('.dsListItem .firstItem').val());
}
});
</code></pre>
<p>Safari Inspector tells me this:</p>
<p>LAST: 11 >>> 10</p>
<p>LAST: 2 >>> 10</p>
<p>LAST: 1 >>> 10</p>
<p>Only 0 and 1 are valid. If 10 is validated as "1", it should not pass 1 > 1 either, but yet it does.</p>
<p>I don't get it why the console.log() print shows the correct integers but when I calculate with it the 10 get's converted into a 1.</p>
<p>I tried casting the number with ($(this).val() * 1), yet that didn't change anything, and anyway; the value is already checked to be a valid numeric value.</p>
|
javascript jquery
|
[3, 5]
|
5,576,344 | 5,576,345 |
Wrapping Image around a Cuboid using C#
|
<p>Hi friends i faced with a new task like converting or merging the rectangular image into a cuboid some thing like a rectangular image to cuboid using c# in asp.net</p>
|
c# asp.net
|
[0, 9]
|
5,058,575 | 5,058,576 |
Firebug giving jQuery "$ is undefined" error even when jQuery is loaded before the script
|
<p>OK so I have a WordPress site. It uses quite a few jQuery scripts and jQuery is loaded in the pages' headers. I have a small block of code that should simple add a class to image links. I have placed this at the bottom of the document, just before the <code></body></code> tag.</p>
<pre><code><script type="text/javascript">
$.noConflict();
$(document).ready(function () {
$('a[href*=".png"], a[href*=".gif"], a[href*=".jpg"]').addClass('zoom');
});
</script>
</code></pre>
<p>The script does not work and Firebug is giving me a <code>$ is undefined</code> error. I have checked various similar other question and the answers do not seem to help.</p>
<p>The source page is here: <a href="http://sergedenimes.com/2013/01/bruno-bisang-30-years-of-polaroids/" rel="nofollow">http://sergedenimes.com/2013/01/bruno-bisang-30-years-of-polaroids/</a></p>
<p>I'm sure it is another plugin causing a conflict but I would appreciate any guidance on how to solve this.</p>
<p>Edit: Wow thanks for the very rapid response. Seems it was an earlier plugin rendering <code>$</code> undefined. Replacing with <code>jQuery</code> has solved.</p>
|
javascript jquery
|
[3, 5]
|
4,899,435 | 4,899,436 |
Converting binary characters to something jQuery can use
|
<p>I’m using the <a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.binarywrite.aspx" rel="nofollow">BinaryWrite</a> method of the HttpResponse class to fetch a web page. </p>
<p>Something similar to the example…</p>
<pre><code>FileStream MyFileStream;
long FileSize;
MyFileStream = new FileStream("APage.html", FileMode.Open);
FileSize = MyFileStream.Length;
byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)FileSize);
MyFileStream.Close();
Response.BinaryWrite(Buffer);
</code></pre>
<p>I’m then using the jQuery ajax method to get that response. But I’m having trouble doing anything with it - so if I had…</p>
<pre><code>$.ajax({
type: "GET",
url: "GetUrl.Proxy",
data: { url: 'http://www.example.org/test.html' },
success: function(data) {
$('iframe').contents().find('html body').html(data.toString());
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}
});
</code></pre>
<p>This returns a stream of binary characters, what I want is something that jQuery can use to set a html element.</p>
|
c# javascript jquery
|
[0, 3, 5]
|
435,982 | 435,983 |
__dopostback is not working in javascript function
|
<p>am calling <code>__dopostback</code> function in javascript while closing event of browser but its not working in Chrome.</p>
<p>the same function is working in IE </p>
<p>can any one give me the solution.</p>
<pre><code><script type="text/javascript" language="javascript">
function doUnload()
{
var btnlogout = document.getElementById("ctl00_lbtn_Logout"); alert(btnlogout);
__doPostBack(btnlogout, '');
}
</script>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
246,999 | 247,000 |
Accessing SessionState in IHttpModule after 404?
|
<p>Is it possible to access SessionState in the Error event handler of a HttpModule following a 404?</p>
<p>Im trying to implement a consistent error handling mechanism for both full and partial postbacks using the technique described in this blog post,</p>
<p><a href="http://blogs.microsoft.co.il/blogs/oshvartz/archive/2008/05/17/asp-net-error-handling-using-httpmodule-full-and-partial-post-back-ajax-updatepanel.aspx?CommentPosted=true#commentmessage" rel="nofollow">ASP.NET Error Handling......</a></p>
<p>Instead of passing loads of parameters on the query string im trying to push the exception into session state and access it from the error page. </p>
<p>SessionState is never available at point I do my Server.Transfer (in error handler of HttpModule) so not available to error page.</p>
<p>Ive tried the trick of resetting the IHttpHandler to one with the IRequestSessionState interface but no joy.</p>
<p>Thanks in advance,</p>
<p>EDIT - The code of the IHttpModule error handler is,</p>
<pre><code>void context_Error(object sender, EventArgs e)
{
try
{
var srcPageUrl = HttpContext.Current.Request.Url.ToString();
// If the error comes our handler we retrieve the query string
if (srcPageUrl.Contains(NO_PAGE_STR))
{
// Deliberate 404 from page error handler so transfer to error page
// SESSION NOT AVAILABLE !!!!
HttpContext.Current.ClearError();
HttpContext.Current.Server.Transfer(string.Format("{0}?ErrorKey={1}", ERROR_PAGE_URL, errorKey), true);
}
else
HttpContext.Current.Server.ClearError();
return;
}
catch (Exception ex)
{
Logging.LogEvent(ex);
}
}
</code></pre>
<p>Matt</p>
|
c# asp.net
|
[0, 9]
|
1,863,299 | 1,863,300 |
handling views by ID
|
<pre><code>for(id=1;id<=33;id++) {
i = new TextView(this);
i.setClickable(true);
i.setOnClickListener(this);
i.setId(id);
i.setBackgroundResource(R.drawable.yes);
AbsoluteLayout.LayoutParams lp2= new AbsoluteLayout.LayoutParams(abc, abc,abc ,abc);
al.addView(i, lp2);
}
i = (TextView) findViewById(4);
i.setBackgroundResource(R.drawable.no);
</code></pre>
<p>This peice of code never works for me.
The
<code>i= (TextView) findViewById(4);</code>
part works.
But then when I try to change the image, the app doesnt run.
Help please</p>
|
java android
|
[1, 4]
|
4,606,618 | 4,606,619 |
Best way to tint my buttons?
|
<p>I'm currently developing an android app where I use transparent png's as buttons for the user interface.</p>
<p>The buttons look kinda like this:</p>
<p><img src="http://i.stack.imgur.com/mGHl7.png" alt="enter image description here"></p>
<p>When the user presses the button I want to automatically tint the non-transparent pixels in the image to a darker color.</p>
<p>Currently I use an xml selector with different drawables for each state. This obviously doesn't scale well since I need to make several versions of each image in photoshop.</p>
<p>Any solutions? I heard that you can use the setColorFilter method on ImageView's to achieve this, but a full explanation would be great!</p>
<p>Thanks!</p>
|
java android
|
[1, 4]
|
1,577,119 | 1,577,120 |
How to enable a linkbutton server control using javascript?
|
<p>I have a linkbutton server control in my page whose Enabled attribute is initially set to "false". When a text box's text changes I would like to enable the linkbutton. I tried the following but it does not work. Could you let me know if i am missing something.</p>
<pre><code>function TextBox_TextChanged()
{
var control = $get("<%= linkButtonSave.ClientID%>");
if(control != null)
control.enabled = true;
}
</code></pre>
<p>Thanks</p>
|
asp.net javascript
|
[9, 3]
|
76,910 | 76,911 |
the pre-init fucntion
|
<p>i am working in a specific task.
I have three master pages with three different stylesheet,</p>
<p>I have a javascript function that can detect what the user is using for example window,mobile or i pad...</p>
<p>when the page size for example is less than 700 i want to set master page 1 foe example and when the page size is greater than 700 i want to set it as master page 2 on the pre-init function of the server side </p>
<p>would anyone have a clue to solve my problem </p>
|
c# javascript
|
[0, 3]
|
1,359,967 | 1,359,968 |
Checkbox uncheck if other checkbox is selected
|
<p>I have many city input checkboxes. I have given the first checkbox the name <strong>All</strong>; if the user selects that then only <strong>All</strong> checkbox gets selected, and not the other city checkboxes.</p>
<p>If the user checks any other city, then the <strong>All</strong> checkbox should automatically be unchecked. I want to do this with JavaScript or jQuery.</p>
<pre><code><input type="checkbox" name="city_pref[]" id="city_all" value="0" checked /><label for="city_all">All</label>
<input type="checkbox" name="city_pref[]" id="city_pref_1" value="Chicago" /><label for="city_pref_1">Chicago</label>
<input type="checkbox" name="city_pref[]" id="city_pref_2" value="Texas" /><label for="city_pref_2">Texas</label>
</code></pre>
<p>and so on....</p>
|
javascript jquery
|
[3, 5]
|
1,078,519 | 1,078,520 |
How do I create a text file on server or memory?
|
<p>How do I create a text file and write the contents of a string to it? I plan to reference to the text file later. It could be on the server (root folder) or anywhere where I can reference it. Below is the string contents</p>
<pre><code> foreach (string s in strValuesToSearch)
{
if (result.Contains(s))
result = result.Replace(s, stringToReplace);
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,144,469 | 1,144,470 |
Editing links inline with jquery - preventing them from being clicked while editing
|
<p>I am attempting to edit sections of a site inline with jQuery, everything is working fine so far, expect that some of the editable items are links. When attempting to edit the fields, it's clicking through on the href.</p>
<p>here is the jQuery:</p>
<pre><code>$(".button-edit").click(function(){
$(".edit").each(function() {
$(this).html('<input type="text" value="' + $(this).html() + '" />');
});
});
</code></pre>
<p>and the html snippet:</p>
<pre><code><li class="list-item" id="list-item-229"><a href="http://test.com/" class="edit">My site</a>
<p class="edit">lorum ipsum description</p></li>
</code></pre>
<p>after the edit button is clicked:</p>
<pre><code><li class="list-item" id="list-item-229"><a href="http://test.com/" class="edit"><input type="text" value="My Site"></a>
<p class="edit"><input type="text" value="lorum ipsum description"/></p></li>
</code></pre>
<p>I've tried using something like:</p>
<pre><code>$('.edit > a').bind("click", function(){
return false;
});
</code></pre>
<p>however it prevents the input fields from being edited. Is there a way to prevent clicks on the href, but keep the input editable?</p>
|
javascript jquery
|
[3, 5]
|
3,438,644 | 3,438,645 |
mouseenter and mouseleave only works with the first element
|
<p>i am fetching this data from database :</p>
<pre><code>$sql = "SELECT * FROM articles WHERE uid='".$uid."'";
$res = mysql_query($sql) or die (mysql_error());
if (mysql_num_rows($res) > 0) {
while ($row = mysql_fetch_assoc($res)) {
$article_id = $row['id'];
$author = $row['author'];
$article_name = $row['article_name'];
$num_views = $row['num_views'];
$rate = $row['rate'];
$times_rated = $row['times_rated'];
$edit_time = $row['edit_time'];
echo "<div id='list_articles'>";
echo "<a class='normal_link' href='view_article.php?id=".$article_id."'>".$article_name."</a>";
echo "<span class='del' id='".$article_id."'>x</span>";
echo "</div>";
}
</code></pre>
<p>And i am using this code to hide the span with class del :</p>
<pre><code>.del {
float:right;
width:10px;
text-align:center;
color:#3B581E;
border:1px solid #3B581E;
display:none;
}
</code></pre>
<p>What i am trying to do is to view the spad with class "del" whenever i <code>mouseenter</code> the div with id <code>list_articles</code> and to hide the same span whenever i <code>mouseleave</code> the div , I am using this jquery code for that :</p>
<pre><code>$(document).ready(function(){
$('#list_articles').mouseenter(function(){
$('span', this).show();
}).mouseleave(function(){
$('span', this).hide();
});
});
</code></pre>
<p>The effect seems to work but only with the first result on my page and does not work with the rest of the divs below , Any idea ??</p>
<p>thanks for help :)</p>
|
php jquery
|
[2, 5]
|
201,803 | 201,804 |
How to check a input IP fall in a specific IP range
|
<p>If we let users input a couple of ip ranges, e.g., 172.16.11.5 - 100, how could I write a fucntion to check if a IP (172.16.11.50) falls in the ranges?</p>
<p>Is there any existing library in .NET to leverage?</p>
|
c# asp.net
|
[0, 9]
|
5,210,537 | 5,210,538 |
jquery, submit form when field loses focus
|
<p>How can I submit a form when a field (In this case the form only has one field) loses focus?</p>
<p>I tried this, but it's not working:</p>
<pre><code>$("form").submit();
</code></pre>
<p><strong>UPDATE</strong></p>
<p>I forgot to mention that the form was created with jquery as well:</p>
<pre><code>$("div").html('<form action="javascript:void(0)" style="display:inline;"><input type="text" value="' + oldValue + '"></form>');
</code></pre>
<p>This is probably why it won't submit, I think it's because the events aren't being observed.</p>
|
javascript jquery
|
[3, 5]
|
5,901,183 | 5,901,184 |
Code behind does not recognize my control variable on its aspx page
|
<p>I have apsx page that has the following simple code:</p>
<pre><code><%@ Page Title="" Language="C#" MasterPageFile="~/Team.master" AutoEventWireup="True" Inherits="Lib.team" Codebehind="team.aspx.cs" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</asp:Content>
</code></pre>
<p>My Behind code is as follow:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace Lib
{
public partial class team : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlDataReader reader = DBData.ExecuteQuery("SELECT * FROM tblTeam");
GridView1. //This is where the error is
}
}
}
</code></pre>
<p>My problem is I can't seem to get the behind code to recognize the control variable GridView1. I am using a web application in VS2010 and below is my project tree:</p>
<p><img src="http://i.stack.imgur.com/RGeRa.png" alt="enter image description here"></p>
<p>I think it is something very simple that I missed. I tried to recheck my namespace, my inherit clause, recompile the project. Any help or guidance would be greatly appreciated.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
3,380,969 | 3,380,970 |
Jquery $().each method obscures 'this' keyword
|
<p>I am creating a Javascript object that contains a function that executes a jQuery <code>each</code> method like the following:</p>
<pre><code>function MyClass {
Method1 = function(obj) {
// Does something here
}
Method2 = function() {
$(".SomeClass").each(function() {
// 1 2
this.Method1(this);
});
}
}
</code></pre>
<p>Which object is each <code>THIS</code> referring to? jQuery is referring to the item returned from the <code>each</code> iteration. However, I would like <code>This[1]</code> to refer to the containing class...</p>
<p>How can I refer to the containing class from within the jQuery loop?</p>
|
javascript jquery
|
[3, 5]
|
4,798,879 | 4,798,880 |
Prevent displaying of previous pages after logout in php
|
<p>I an using session_cache_limiter ('private_no_expire, must-revalidate'); on each page to avoid "Web page has expired" issue, so that issue is resolved. But i am facing the problem with logout. When i clicked log out the page is redirect to index page but when i clicked browser back button it redirects me to previous page which should not happened. I checked out previous solutions but nothing works for me. Any help will be grateful.
Thanks</p>
|
php javascript
|
[2, 3]
|
1,282,758 | 1,282,759 |
Can I get wmode parameter from Flash object?
|
<p>I am working on a site that includes Flash-based third party ads. Some of these ads do not have a wmode parameter set, and so when we pop up an overlay from our site, the ad blocks it or appears on top of it. We do not have the ability to insert wmode parameters into the ads. </p>
<p>Is there a way to determine which ads do not have that wmode parameter set (i.e. get the wmode value for each ad), so I can hide those ads when we pop up an overlay? The ad sales team has already specified that they do not want to hide the compliant ads in those situations, so I need to hide only those ads that would block our overlays.</p>
<p>Note: I am using jQuery Colorbox for the overlays, if that matters.</p>
|
javascript jquery
|
[3, 5]
|
1,525,131 | 1,525,132 |
Getting error as ThisApplicatio.workbook does not exists
|
<p>I have written the following code to refer to a work book but i am getting the error as i specified</p>
<pre><code> Microsoft.Office.Interop.Excel.Workbook wb = ThisApplication.Workbooks[1];
</code></pre>
<p>I have gone through this page here <a href="http://msdn.microsoft.com/en-us/library/aa168292%28v=office.11%29.aspx" rel="nofollow">MSDN</a></p>
<p>Can any one tell what to do</p>
|
c# asp.net
|
[0, 9]
|
1,719,114 | 1,719,115 |
Theme has superfish - how to add supersubs?
|
<p>I'm using a theme that is using Superfish for the navigation menu. The problem is, if the sub item is too long it will drop underneath, i want to keep the individual menu item's text on one line.</p>
<p>Now i've found supersubs for the superfish menu but i don't know how to add it to the theme.</p>
<p>This is in the functions.php file.</p>
<pre><code>wp_enqueue_script('superfish', get_stylesheet_directory_uri() . '/js/superfish.js');
</code></pre>
<p>and this is in the header.php file.</p>
<pre><code><script type="text/javascript">
jQuery(function($){
$(document).ready(function(){
//Drop Down Menu
$('ul.sf-menu').superfish({
delay: 1000,
animation: {opacity:'show',height:'show'},
speed: 'normal',
autoArrows: true,
dropShadows: false
});
});
});
</script>
</code></pre>
<p>How can i add supersubs to the menu as well to solve the problem i'm having with the sub items.</p>
<p>Thanks</p>
|
jquery javascript
|
[5, 3]
|
2,699,223 | 2,699,224 |
Android: VIewFlipper and onBackPressed not responding
|
<p>Developing in Android 2.1, I have a ViewFlipper layout with 3 includes and I have tried to explicitly make the program go back one include when pressing the 'Back' button.</p>
<pre><code>@Override
public void onBackPressed() {
switch (backStatus) {
case 0: finish();
case 1: //TODO Check save
case 2: a.animateLeft(Flipper);
case 99: setContentView(R.layout.main);
}
}
</code></pre>
<p>I have also tried using the onKeyDown/Up call with the same code.</p>
<p>Obviously backStatus changes when it moves to another include.
The problem is, and I'll give one example... on the 3rd ("case 2") include is a list of options that work into include 2. If the user wanted to cancel that and press the back button (to call a.animateLeft(Flipper)) it should go straight back to the 2nd include, but it doesn't. It goes straight back to the 1st include. Furthermore it disables the Click listeners on the buttons so now none of them respond.</p>
<p>Leaving "case 2" out does disable it altogether on that include, which obviously is no good. All the code for animating left and right works fine from on screen buttons and the correct backStatus flag is passed when switching flippers. Does anyone know how I can solve this little pickle?</p>
<p>Thanks in advance, AW.</p>
|
java android
|
[1, 4]
|
1,382,642 | 1,382,643 |
Set Session in codebehind for an Onclick
|
<p>How can i add Session value in codebehind. I have tried doing it this way but the session does nt have any value. </p>
<pre><code> x is string.
td1.InnerHtml = "<a href=\"Search.aspx\" onClick=\"Session['catvalue']=" + x + "\">" + x +</a>
</code></pre>
<p>Thank you in advance!</p>
|
c# asp.net
|
[0, 9]
|
2,346,545 | 2,346,546 |
Efficiency: Page_load vs Ajax call on page request
|
<p>When my page gets hit, is it better practice to have my functionality in the <code>page_load</code> of the cs file or in the <code>$(document).ready(funtion() {});</code> have an ajax call to a webmethod?</p>
<p>Which way will be more efficient, I am leaning towards the Ajax call, but my mind is saying that it will be double work? (Load the page and then also call the WebMethod)</p>
<p>Thanks.</p>
|
jquery asp.net
|
[5, 9]
|
978,650 | 978,651 |
How to send data from a C# ASP.NET Web Page to a java webservices
|
<p>I have created a C# ASP.NET web page(Front End) to collect information from user and I would like to know how to send the information to a java web services to process the information which is from the web page?</p>
|
java asp.net
|
[1, 9]
|
4,230,154 | 4,230,155 |
How to display a page only for the first time in asp.net
|
<p>I am developing an application using Asp.Net.My question is whether there is any solution to display a page only for the first time.i.e when the user logs in for the first time it should ask to change the password but when the user logs in after changing the password it should not display the changepassword page instead it should redirect to another page.I have used session variables to do this but after the session expires its again showing the change password page.Can anyone help me to solve this problem.</p>
|
c# asp.net
|
[0, 9]
|
3,197,082 | 3,197,083 |
Include jQuery in the Javascript Console
|
<p>Is there an easy way to include jQuery in the chrome Javascript Console for sites that do not use it? For example - on a website I would like to get the number of rows in a table. I know this is really easy with jQuery.</p>
<pre><code>$('element').length;
</code></pre>
<p>But the site does not use jQuery. Can I add it in from the command line?</p>
|
javascript jquery
|
[3, 5]
|
5,650,217 | 5,650,218 |
Obtaining Phone number
|
<p>I am trying to get the user's phone number but the problem is that I am getting null response
based on my research so far we can get the same by using the object of TelePhony Manager and calling function getLine1Number()</p>
<p>but I am not getting any response,somebody suggested that this is because the service provider is not providing the same in my country I am in India but for blackberry it's providing the phone number so what could be the possible problem please suggest my whole algo depends on this.</p>
|
java android
|
[1, 4]
|
566,450 | 566,451 |
Unable to include iostream in android why?
|
<p>Have installed android-ndk-r7, and trying to compile .cpp file.</p>
<pre><code>#include <iostream>
using namespace std;
int main ( int argc, char ** argv)
{
cout <<"Hello World.."<<endl;
}
</code></pre>
<p>Executed following command:
Got into jni folder, and executed </p>
<pre><code>#ndk-build
</code></pre>
<p>Got following error:</p>
<pre><code>/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp:1:20: error: iostream: No such file or directory
/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp: In function 'int main(int, char**)':
/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp:8: error: 'cout' was not declared in this scope
/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp:8: error: 'endl' was not declared in this scope
make: *** [/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/obj/local/armeabi/objs/test1/test1.o] Error 1
</code></pre>
<p>What am i doing wrong ?</p>
<p>My Android.mk file looks like:</p>
<pre><code># A simple test for the minimal standard C++ library
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test1
LOCAL_SRC_FILES := test1.cpp
include $(BUILD_EXECUTABLE)
</code></pre>
<p>and Application.mk file looks like:</p>
<pre><code># Build both ARMv5TE and ARMv7-A machine code.
APP_ABI := armeabi armeabi-v7a
</code></pre>
<p>Kindly point out the mistake?</p>
|
android c++
|
[4, 6]
|
5,424,978 | 5,424,979 |
Retain Password Field Value on PostBack
|
<p>Right now I have an asp:Wizard with 3 Steps.</p>
<ol>
<li>Create User</li>
<li>Form to Email</li>
<li>Summary of Fields</li>
</ol>
<p>When the finish button is clicked on the third step I would like to Create the user and send the form. I have the logic for this written but the only problem I have is the when the next button is pressed on a wizard, a PostBack occurs and my password field:</p>
<pre><code><asp:TextBox ID="txtPassword" TextMode="Password" Width="70%" runat="server" />
</code></pre>
<p>Does not retain its value. </p>
<p>What would you suggest would be the most secure and practical method for me to overcome this problem?</p>
|
c# asp.net
|
[0, 9]
|
5,161,846 | 5,161,847 |
How can I make this jQuery "shrink text" function more efficient? With binary Search?
|
<p>I've built jQuery function that takes a text string and a width as inputs, then shrinks that piece of text until it's no larger than the width, like so:</p>
<pre><code>function constrain(text, ideal_width){
var temp = $('.temp_item');
temp.html(text);
var item_width = temp.width();
var ideal = parseInt(ideal_width);
var smaller_text = text;
var original = text.length;
while (item_width > ideal) {
smaller_text = smaller_text.substr(0, (smaller_text.length-1));
temp.html(smaller_text);
item_width = temp.width();
}
var final_length = smaller_text.length;
if (final_length != original) {
return (smaller_text + '&hellip;');
} else {
return text;
}
}
</code></pre>
<p>This works fine, but because I'm calling the function on many pieces of texts, on any browser except Safari 4 and Chrome, it's really slow.</p>
<p>I've tried using a binary search method to make this more efficient, but what I have so far brings up a slow script dialog in my browser:</p>
<pre><code>function constrain(text, ideal_width){
var temp = $('.temp_item');
temp.html(text);
var item_width = temp.width();
var ideal = parseInt(ideal_width);
var lower = 0;
var original = text.length;
var higher = text.length;
while (item_width != ideal) {
var mid = parseInt((lower + higher) / 2);
var smaller_text = text.substr(0, mid);
temp.html(smaller_text);
item_width = temp.width();
if (item_width > ideal) {
// make smaller to the mean of "lower" and this
higher = mid - 1;
} else {
// make larger to the mean of "higher" and this
lower = mid + 1;
}
}
var final_length = smaller_text.length;
if (final_length != original) {
return (smaller_text + '&hellip;');
} else {
return text;
}
}
</code></pre>
<p>Does anyone have an idea of what I should be doing to make this function as efficient as possible?</p>
<p>Thanks! Simon</p>
|
javascript jquery
|
[3, 5]
|
582,380 | 582,381 |
Vector-Java equivalent in PHP?
|
<p>Is there a:</p>
<p>1> Vector(Java) class<br>
2> ListIterator<br>
3> Single Linkedlist </p>
<p>equivalent available in PHP?</p>
|
java php
|
[1, 2]
|
4,258,815 | 4,258,816 |
How to add reverse scroll functionality to jQuery.SerialScroll?
|
<p>i am using jQuery.SerialScroll in my website.</p>
<p>Everything is working fine except </p>
<p>i just want that when my slider finish scrolling then it should scroll in reverse direction one by one step.</p>
<p>But currently it will scroll complete image at once and reach to start point after finishing up.</p>
<p>So please tell me how can i do this ?</p>
<p>for jQuery.SerialScroll reference you can check this link:http://flesler.blogspot.com/2008/02/jqueryserialscroll.html</p>
|
javascript jquery
|
[3, 5]
|
1,506,477 | 1,506,478 |
Make jquery toggle work with dynamic content
|
<p>I've the following code on my website: <a href="http://jsfiddle.net/dJLK3/1/" rel="nofollow">http://jsfiddle.net/dJLK3/1/</a>
As you can see, it works just fine.</p>
<p>The problem is: those divs and link triggers come from a database. Today I have 1, tomorrow it can be 10...</p>
<p>I can not figure out how to convert it and make it work without needing to right lot's of codes like link1, link2, link3, link4, link5 and so on...</p>
<p>Anyone? :)</p>
|
javascript jquery
|
[3, 5]
|
5,192,364 | 5,192,365 |
How to get mac address of client in asp.net?
|
<p>i want get mac address of my website visitor in asp.net
how can i do it?</p>
<p>this code get host mac address</p>
<pre><code> ManagementClass objMC = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection objMOC = objMC.GetInstances();
foreach (ManagementObject objMO in objMOC)
{
if (!(bool)objMO["ipEnabled"])
continue;
string a = ((string)objMO["MACAddress"]);
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,654,273 | 3,654,274 |
Adding multiple boxes in one page and saving the info from each box
|
<p>I have this task - to make a simple CMS where one of the abilities should be to create a page and add as many boxes as the admin would like and then to have the ability to edit each one of them using ckeditor, and ofcourse the page should be visible in the frontend.</p>
<p>For now I'm just using CodeIgniter trying to keep things simple but for this task I can't think of pure PHP solution. I'm not much into JS and it's libraries/frameworks so what do you think is the solution with the smallest learning curve? I can't invest too much time in this, so I'm searching for an easy to implement solution (if there is such)?</p>
|
php javascript
|
[2, 3]
|
2,884,231 | 2,884,232 |
Executing ASP.NET 1.1 Code within Javascript
|
<p>When the user clicks a certain LinkButton, I need to open a confirmation dialog with OK/Cancel. If the user hits OK, then I need to run a function from ASP.NET (something to update the database).</p>
<p>Something like the following...</p>
<p><strong>Javascript</strong></p>
<p><code>function openConfirm() {
return window.confirm("Are you sure you want to do this?");
}</code></p>
<p><strong>ASP</strong></p>
<p><code><asp:LinkButton runat="server" CommandName="viewPart" onClick="if(openConfirm() === true) <% SomeASPFunctionCall() %>;">Delete</asp:LinkButton></code></p>
<p>The catch is that my application is running ASP.NET 1.1, so any references to adding an <code>OnClientClick</code> to the control is irrelevant (because <code>OnClientClick</code> has been added for ASP 2.0). I have tried postbacks via __doPostBack and the __eventObject and __eventArguments, but those simply do not work or I can't figure it out.</p>
<p>How should I manage this combination of client-side/server-side interaction?</p>
<p>Thank you</p>
|
javascript asp.net
|
[3, 9]
|
1,207,853 | 1,207,854 |
jQuery / JS - Detecting / Matching an URL string to determine it's type
|
<p>I have two URLs types, (TYPE A)</p>
<pre><code>/items
</code></pre>
<p>Or /items/XXXX with a trailing number (TYPE B)</p>
<pre><code>/items/187
/items/12831
</code></pre>
<p>I would like to know how to detect if the URL is type A or Type B</p>
<pre><code>if (TYPE A) ... else if (TYPE B) ....
</code></pre>
<p>Any suggestions for making this happen? Do I need a regex?</p>
<p>thanks</p>
|
javascript jquery
|
[3, 5]
|
587,057 | 587,058 |
How can I create a dynamic form using jQuery
|
<p>How can I create a dynamic form using jQuery. For example if I have to repeat a block of html for 3 times and show them one by one and also how can I fetch the value of this dynamic form value.</p>
<pre class="lang-html prettyprint-override"><code><div>
<div>Name: <input type="text" id="name"></div>
<div>Address: <input type="text" id="address"></div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
789,219 | 789,220 |
JQuery onclick do something ... after click alert
|
<p>I am using this code:</p>
<p><code>onclick="$('#default').click();"</code> ... is there any way to return an alert of something if it's done sucessfully?</p>
<p>Update:</p>
<p>There seems to be a proble here:</p>
<pre><code>onclick="$('#default').click( function() { alert('clicked'); });"
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,670,487 | 3,670,488 |
I want to get the row value from the gridview into another gridview and use it for calculation
|
<p>I want to get the value from the gridview into another gridview and use it for calculation..</p>
<p>my first gridview as</p>
<pre><code> depotcode|depotname|lat_deg|lat_min |lat_sec| lon_deg |lon_min |lon_sec |lat_decimaldegree |lon_decimaldegree|
</code></pre>
<p>my secondgridview as</p>
<pre><code> depotcode |custwt |custname| lat_deg |lat_min |lat_sec |lon_deg |lon_min |lon_sec |lat_decimaldegree |lon_decimaldegree.|
</code></pre>
<p>now to calculate difference between the 2longitude i need lon_decimaldegree from gridview1 and use it in second gridview.. please help to do this</p>
|
c# asp.net
|
[0, 9]
|
3,697,926 | 3,697,927 |
ClassCastException when getting the selected item of ListView as string or textview
|
<p>I got <strong>runtime error</strong> exception: </p>
<pre><code>java.lang.ClassCastException: android.widget.TwoLineListItem cannot be cast to android.widget.TextView
</code></pre>
<p>My Activity extends Activity <strong>NOT</strong> ListActivity and here is my layout construction:</p>
<pre><code><LinearLayout ...> <ListView ...></ListView> </LinearLayout>
</code></pre>
<p><strong>Java:</strong></p>
<pre><code> ListView lv1 = (ListView) findViewById(R.id.listViewXMLdata);
ArrayAdapter<String> arrAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_2,
android.R.id.text2, getResources().getStringArray(R.array.countries));
lv1.setAdapter(arrAdapter);
lv1.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
lView.getItemAtPosition(position);
String itemSelected = ((TextView) view).getText().toString();
Toast.makeText(getApplicationContext(), "Clicked Position Number " + position + ": " + itemSelected ,
Toast.LENGTH_SHORT)
.show();
}
});
</code></pre>
<p>My only main concern is just to get the string (item selected) on my list.</p>
<p><strong>NOTE 1</strong>: I am not working on any database.</p>
<p><strong>NOTE 2</strong>: I already tried casting it to CharSequence itemSelected = ((TextView) view).getText().toString() but still got runtime error.</p>
<p>The runtime error occurs only when I started to select item on the list.</p>
|
java android
|
[1, 4]
|
4,180,699 | 4,180,700 |
Getting HTML textbox input
|
<p>I need some help with ASP.NET.</p>
<p>I have an html page that has a form tag with a couple of input tags and I want to do a Post.</p>
<p>Now on the server, I'm implementing IHTTPHandler. I get the response, but i don't see my input data.</p>
<p>How can i get what the user types in into the input tags in the http handler. I was able to do this before. But now i can't find where in the context object the results are.</p>
|
c# asp.net
|
[0, 9]
|
1,000,173 | 1,000,174 |
problem in showing listview in horizontal layout?
|
<p>I am trying to show a list view with calendar view in a linear layout. when i am using vertical layout then list view appears but in horizontal layout the same listview disaappears. I solved the problem using relative layout, but can i do this using linear layout.here is my xml...</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.exina.android.calendar.CalendarView
android:layout_height="wrap_content"
android:id="@+id/calendar" android:layout_width="wrap_content">
</com.exina.android.calendar.CalendarView>
<ListView android:layout_height="fill_parent" android:id="@+id/android:list"
android:layout_weight="1" android:scrollingCache="false"
android:layout_width="fill_parent" android:drawSelectorOnTop="false"
android:dividerHeight="4.0sp"></ListView>
</LinearLayout>
</ScrollView>
</code></pre>
|
java android
|
[1, 4]
|
4,533,253 | 4,533,254 |
enable/disable radiobuttonlist with javascript
|
<p>I am trying to enable/disable radiobuttonlist with javascript code. This javascript is working fine with textboxes but it looks like that it doesn't work with radiobuttonlist.
Here is the code I am using:</p>
<pre><code> var chkEPM = document.getElementById("<%=chkEPM.ClientID %>");
chkEPM.onchange = function () {
if (this.checked == true)
document.getElementById("<%=rblEPM.ClientID %>").disabled = false;
else
document.getElementById("<%=rblEPM.ClientID %>").disabled = true;
};
</code></pre>
<p>Thanks in advance for each reply and have a good day/night</p>
|
javascript asp.net
|
[3, 9]
|
2,536,605 | 2,536,606 |
How to make Android emulator boot faster
|
<p>I'm currently stuck with using Atom CPU desktop for my Android app development. What are the ways to improve its boot time. When running the emulator I can see that the number of cores used by the emulator is just one, I'm running the emulator from within the Eclipse ADT plugin. </p>
<ul>
<li>How can I make the emulator use two cores instead of just one?</li>
<li>What are the emulator setting that will make boot faster?</li>
</ul>
<p>My android project will be mainly a PhoneGap + jQuery android app.</p>
|
java android
|
[1, 4]
|
2,983,217 | 2,983,218 |
How to use vector with jquery
|
<p>Im using jquery to load a listbox based on another list box.
For that Im setting the data base values(list box values) to a vector.
If it is a single value then response.getwriter.write(string) will send the response to the jsp and with the help of this I can set it to the another list box.But how can I able to get these vector values in jsp.Can any one please give the sample code.</p>
|
java jquery
|
[1, 5]
|
4,928,288 | 4,928,289 |
Add container #id to .load('$(this).attr("href"));
|
<p>I want to pull only a specific div from the page my link is pointing to.</p>
<p>My links are formatted like this : <code><a href="about-smith.asp" class="pic">img</a></code></p>
<pre><code>$(function(){
$("a.pic").live('click', function (e) {
e.preventDefault();
$("#subsidebar").load($(this).attr("href") + "#subcontent");
});
});
</code></pre>
<p>And I want that to pull only the #subcontent div from about-smith.asp. It's displaying the content in the #subsidebar div, but it's the <em>entire</em> page.</p>
|
javascript jquery
|
[3, 5]
|
773,018 | 773,019 |
how to add cancel button inside spinner
|
<p>I want to add cancel button inside of spinner how to add cancel button in spinner without </p>
<p>using alert dialog please give me an example..</p>
<p>spinner = (Spinner) findViewById(R.id.spinner);</p>
<pre><code> ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(),R.layout.test_list_item,stringArray);
adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
spinner.setAdapter((adapter));
</code></pre>
|
java android
|
[1, 4]
|
805,576 | 805,577 |
Navigation quickly disappearing
|
<ol>
<li><p>My navigation dropdown quickly disappears when you're trying to hover over the menu. How can I possibly delay the disappearance of the navigation by some miliseconds/seconds? </p></li>
<li><p>Again, say when you hover over the <code>menu</code> (e.g. sub-item 0.1 etc) of <code>Folder 1/Folder 2</code>, I want it will have a blue color to show that it's active.</p></li>
</ol>
<p>Please check <a href="http://jsfiddle.net/SgyeB/" rel="nofollow">this JSFiddle</a> to see the JS, CSS, and HTML.</p>
<p>going ahead and editing this <code>fadesettings: {overduration: 350, outduration: 2000}</code>in the js only changes the animation speed. But THAT IS NOT what I want. I'm talking about the <code>DURATION</code> the menu exist before disappearing not the <code>speed of the animation</code> </p>
|
javascript jquery
|
[3, 5]
|
3,355,421 | 3,355,422 |
What's the name of exception for app pool recycle?
|
<p>I need to do some custom processing when method fails on app pool recycle, app domain recycle, or IIS shutdown. Is there a specific exception type? maybe: ApplicationException? instead of using generic <code>Catch (exception ex)</code></p>
|
c# asp.net
|
[0, 9]
|
5,818,203 | 5,818,204 |
open a url on change of dropdown
|
<p>"I need to navigate to a url on change of dropdown such that it would have done in by clicking on a link as <code><a href="www.abc.com" target="_blank"></code></p>
<p>My dropdown is </p>
<pre><code><select onchange="goTo(this);">
<option selected="selected" disabled="disabled">Back to..</option>
<option value="0">Manageassesment
</option> <option value="1">Job post
</option>
</select>
</code></pre>
<p>goTo function is </p>
<pre><code>function goTo(ctrl){
document.location.href = (ctrl.selectedIndex) ? "www.qwe.com":"www.asd.com";
</code></pre>
<p>}</p>
<p>Now the problem is this goTo opens the url in same window but i want that it should do as it would be doing in clicking on an anchor with target="_blank"</p>
|
javascript jquery
|
[3, 5]
|
3,125,795 | 3,125,796 |
Traverse JSON data with jQuery
|
<p>I can't figure out how to get a bunch of MySQL rows into a JSON data structure and iterate each of the row fields in java script.</p>
<p>Here is my query in codeigniter</p>
<pre><code>function get_search_results() {
//$this->db->like('title', $searchText);
//$this->db->orderby('title');
$query = $this->db->get('movies');
if($query->num_rows() > 0) {
foreach($query->result() as $movie) {
$movies[] = $movie->title;
}
}
return $movies;
}
</code></pre>
<p>Encode array for json</p>
<pre><code>$rows= $this->movie_model->get_search_results();
echo json_encode($rows);
</code></pre>
<p>My jQuery AJAX request, </p>
<pre><code> $.ajax({
type: "GET",
url: "publishlinks/search_movies",
data: searchString,
...
</code></pre>
<p>This is how I've been trying to traverse rows in the java script. It is iterating over every character: 1 t 2 h 3 e 4 g ... 7 e
I need this: 1 the game 2 lost 3 you</p>
<pre><code> success:
function(result) {
$.each(result, function(key, val) {
alert(key + ' ' + val);
})
//alert(result);
}
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
4,701,302 | 4,701,303 |
Set current url with jQuery?
|
<p>How do change the url shown with the jQuery? With pagination, I do an ajax call to get the next page, but I want to update the url for bookmarking purposes. How do I do that?</p>
|
javascript jquery
|
[3, 5]
|
5,963,244 | 5,963,245 |
Javascript/jQuery height calculation
|
<p>Im looking for a way, in javascript, to calculate the size of the browser <code>(px)</code> then calculate the size of a <code><div></code> taking away <code>50px</code> from that full screen size:</p>
<p>E.g.</p>
<pre><code>Browser screen size: 800px (Height)
Existing <div> that is always 50px (Height)
Leaves 750px (Height) for the remaining <div> to fill the page.
</code></pre>
<p>Then take that <code>750px</code> and apply it as inline style:</p>
<pre><code><div style="height: 50px">
<img src="banner.png" />
</div>
<div style="height: x">
This fills the remainder of the page
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,134,569 | 1,134,570 |
visual c++ run java class as process
|
<p>Something like NativeJ which is able to run Java application as myjava.exe in the task manager instead of displaying as java.exe. Please advice how do I code it from scratch in Visual studio 2010.</p>
|
java c++
|
[1, 6]
|
4,288,840 | 4,288,841 |
Get a session back from a class in another class
|
<p>I have a class where i am setting and getting a session. I am fairly new to C#
How can i retrieve a session from my class in another class?</p>
<p>Here is my session class.</p>
<pre><code>public class JobApplicantSession
{
public JobApplication ApplicationSession
{
get
{
JobApplication _application = (JobApplication)HttpContext.Current.Session["Application"];
return _application;
}
set
{
HttpContext.Current.Session["Application"] = value;
// Session["Application"] = value;
}
}
</code></pre>
<p>I am able to set the session. However, getting it i dont know how.
I made an object of the class and the object can access the function name ApplicationSession</p>
<pre><code>JobApplicantSession sess = new JobApplicantSession();
sess.ApplicationSession
</code></pre>
<p>I know it probobly depends on what i need to do with it, but i just wanted to verify its setting and getting properly</p>
|
c# asp.net
|
[0, 9]
|
4,713,291 | 4,713,292 |
Detect when link is clicked, open in new frame
|
<p>I would like to create a basic URL rewrite using frames. I don't have access to .htaccess to do mod_rewrite. Is there a way using PHP, jQuery, JavaScript etc. to detect which URL has been clicked on and then open URL in new frame? Ex: user clicks on <code>/index.php?12345</code> it will open in framed window <code>/pages/12345/index.html</code> and if they click on <code>/index.php?54321</code> URL will open in framed window <code>/pages/54321/index.html</code></p>
|
php javascript jquery
|
[2, 3, 5]
|
441,140 | 441,141 |
how can I handle SMS send/receive ?
|
<p>I want to write method to send SMS on number and with text from edit text fields. After message is sent I want to receive some sound or something to alert me that SMS is received. How can I do that?
Thank you in advance,
Wolf.</p>
|
java android
|
[1, 4]
|
2,444,695 | 2,444,696 |
ViewTreeObserver Listener not called after some time
|
<p>I have great difficulties when using ViewTreeObserver. All works fine for some unpredictable period of time, and then the listener is not operational anymore. It is certainly because of what is written in the doc:<strong>The returned ViewTreeObserver observer is not guaranteed to remain valid for the lifetime of this View</strong>
Therefore i redo the setup every time I change my view:</p>
<pre><code> protected void shrinkToFit(final TextView t) {
if(vto==null||!vto.isAlive()){
vto = t.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
public void onGlobalLayout() {
doAdjust(t);
}
});
}
}
</code></pre>
<p>and here's how I invoke it:</p>
<pre><code>TextView t = (TextView) findViewById(R.id.maindesc);
t.setTextSize(Constants.MAINDESC_SIZE);
String todisp_1 = tarifreadtemp.area_desc + ":"
+ tarifreadtemp.area_tarifuserdesc;
shrinkToFit(t);
t.setText(todisp_1);
t.invalidate();
</code></pre>
|
java android
|
[1, 4]
|
1,084,132 | 1,084,133 |
Filter in DIV content
|
<p>I have made <a href="http://jsfiddle.net/hari_it_ram/fbC6w/" rel="nofollow">this jsFiddle</a> for searching/filtering the <code>div</code> content which I am getting from an XML response. But I have done it for one text box alone. Any one can help me in implementing for next three?</p>
<p>For example:</p>
<p>If I am typing <code>pd001</code> it shows the first 2 rows and if I type paste it should reach and filter from the current visible list, not from the whole list.</p>
<p>Kindly help me out on this.</p>
|
javascript jquery
|
[3, 5]
|
294,371 | 294,372 |
Javascript error in asp.net
|
<p>I have a calendar control that is hosted on an iframe. I get a javascript error when I click on a date on the calendar. <strong>window.top.document.getElementById(..) is null or not an object</strong> </p>
<p>The iframe is hosted on another page ConfigSettings.aspx </p>
<p>The code in the calendar control code behind is: </p>
<pre><code>Dim sjscript As String = "<script language=""javascript"" type=""text/javascript"">"
sjscript &= "window.top.document.getElementById('" & HttpContext.Current.Request.QueryString("DateTextID") & "').value = '" & Calendar1.SelectedDate & "';"
sjscript &= "window.top.document.getElementById('" & HttpContext.Current.Request.QueryString("DateTextID") & "1').style.display = 'none';"
sjscript = sjscript & "</script" & ">"
Literal1.Text = sjscript
</code></pre>
<p>The html code is: </p>
<pre><code><input type="text" class="TextBox" id="ToDate" runat="server"/>
<a href="javascript:ShowCalendar('ToDate1')"><img src="images/Calendar.jpg" border="0" /></a>
<iframe src="Calendar.aspx?DateTextID=ToDate" style="display:none; width:200px; height:100px" name="ToDate1" id="ToDate1"></iframe>
<asp:Label runat="server" ID="lblEndTime" Text="End Time:"></asp:Label>
</code></pre>
<p>What would be causing the error?</p>
|
javascript asp.net
|
[3, 9]
|
4,042,374 | 4,042,375 |
jquery call to javascript function that returns true returns undefined
|
<p>I have a jquery function that is triggered by a button click. When it then calls a javascript function that returns true however, jquery claims the value is undefined. </p>
<pre><code>function mytrue()
{
alert ("true is returned");
return true;
}
$('#save').click(function()
{
var response = mytrue();
if (response) {
alert ("This should work!");
} else
{
alert ("This is puzzeling? "+response);
}
}
</code></pre>
<p>I get the "true is returned" alert and the "This is puzzeling? undefined" alert.</p>
|
javascript jquery
|
[3, 5]
|
5,167,027 | 5,167,028 |
Loading JWplayer dynamically
|
<p>Hi and thanks for looking into this.</p>
<p>I have a code I've been working on to add videos to my site. All videos are from youtube. Once a user has clicked on submit, a link becomes visible. When clicking on it the user can preview the video.</p>
<p>One week ago I used the following to achieve this:</p>
<pre><code>$("#result").html('<a href="javascript:initPlayer(\'http://www.youtube.com/watch?v=kXhy7ZsiR50\')>Preview video</a><br>');
</code></pre>
<p>Everything worked fine. But today I was trying the script and the link doesn't appear anymore. The link works however fine if I do something like:</p>
<pre><code><a href="javascript:initPlayer('http://www.youtube.com/watch?v=kXhy7ZsiR50')">Preview video</a>
</code></pre>
<p>Somewhere on the page.</p>
<p>I don't know why the call with jQuery doesn't work anymore. It worked fine when I was developing the website. I tried it on different browsers, but with the same result in the end.</p>
<p>Anyone any idea how to solve this? I'm starting to pull out my hair. :)</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
5,518,605 | 5,518,606 |
How to get type of input object
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1940471/how-do-i-determine-an-html-input-element-type-upon-an-event-using-jquery">How do I determine an HTML input element type upon an event using jQuery?</a> </p>
</blockquote>
<p>I want to get type of input object but I alway got "undefined". <br/>
What is missing it this code?</p>
<pre><code>var c = $("input[name=\'lastName\']");
c.val("test");
alert(c.type);
</code></pre>
<p>My form</p>
<pre><code><form action="formAction.jsp" method="post">
FirstName <input type="text" name="firstName" id="firstName"></input><br/>
LastName <input type="text" name="lastName"></input><br/>
Address <input type="text" name="address"></input><br/>
Tel <input type="text" name="tel"></input><br/>
Email <input type="text" name="email"></input><br/>
</form>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,240,277 | 4,240,278 |
How can I select an element based on its position?
|
<p>How is it possible to select an element based on its position?</p>
<pre><code><div id="parent">
<p id="text">This is a text</p>
</div>
</code></pre>
<p>//CSS</p>
<pre><code>#parent{width:100px;height:100px;position:absolute;left:100px;top:100px;}
</code></pre>
<p>Now using the left=100px,top=100px how can I select the div element using JQuery?</p>
|
javascript jquery
|
[3, 5]
|
2,450,065 | 2,450,066 |
asp checkbox not firing jquery function
|
<p>Ok I have checked several solution and have no luck. What the heck am I doing wrong. I can retrieve the ID from check_controls doing an alert onload but not on change</p>
<pre><code><asp:CheckBox ID="chkAutoReverse" runat="server" CssClass="" Width="200px"
Text="Auto Reverse:" TextAlign="Right" AutoPostBack="false" />
$(document).ready(function() {
var check_controls = $('input[id*=chkAutoReverse]');
var AutoReverseOptions = document.getElementById('AutoReverseOptions');
$(check_controls).change(function() {
if ($(this).is(':checked')) {
alert($(check_controls).attr("id"));
} else {
alert($(AutoReverseOptions).attr("id"));
}
});
});
</code></pre>
<p>additional html markup</p>
<pre><code> <div style="height: 60px">
<div class="singlepanelcontentleft">
<asp:CheckBox ID="chkAutoReverse" runat="server" CssClass="" Width="200px" Text="Auto Reverse:"
TextAlign="Right" AutoPostBack="false" /></div>
<div id="AutoReverseOptions" class="singlepanelcontentleft" style="display: none;">
<asp:RadioButtonList ID="optTabs" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table"
Width="91%" Height="22px">
<asp:ListItem Text="Next Period" Value="1" Selected="true"></asp:ListItem>
<asp:ListItem Text="2 Periods from Now" Value="2"></asp:ListItem>
<asp:ListItem Text="3 Periods from Now" Value="3"></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
</code></pre>
<p>this is nested in other divs and a fieldset. Pasting the other code did not render well</p>
|
jquery asp.net
|
[5, 9]
|
2,867,000 | 2,867,001 |
How can I get the contents of my table with dynamic row adding?
|
<p>how to retrieve from the server-side contained a table html constructed this way:</p>
<pre><code> <table id="myTable" >
<tr>
<th> <input type="text" value="name"/></th>
<th> <input type="text" value="quantity" /> </th>
</tr>
<tr>
<th> <input id="name_1" value="phone" /> </th>
<th> <input id="quantity_1" value="15" /> </th>
</tr>
<tr>
<th> <input id="name_2" value="mp3" /> </th>
<th> <input id="quantity_2" value="26" /> </th>
</tr>
</table>
</code></pre>
<p>I can not make use of <code><asp:Table> ...</code> because for technical reasons I did not find a solution following this post: <a href="http://stackoverflow.com/questions/3003912/how-to-dynamic-adding-rows-into-asp-net-table">http://stackoverflow.com/questions/3003912/how-to-dynamic-adding-rows-into-asp-net-table</a></p>
<p>How can retrieve the contents values of my table (dynamic) for each row. Rows will be added in client-side js</p>
<p>Thank you.</p>
|
c# asp.net
|
[0, 9]
|
752,134 | 752,135 |
gridview updating a particular record after search
|
<p>1.I have one grid having 100 records and it is in updatepanel.
2.I have implimented search using jquery.
3. when i found that record after search then i when i go for for editing all the records are comming.
4. what i want is to have only that record to display for updating.
here is my code</p>
<pre><code>$(document).ready(function () {
GridFilter();
});
function pageLoad(sender, args) {
if (args.get_isPartialLoad()) {
GridFilter();
}
}
function GridFilter() {
$('#ContentPlaceHolder1_gvTransactionType').GridviewFix().dataTable({
"bPaginate": false,
"sDom": 't<"clear">',
"bSort": false
})
.columnFilter({ sPlaceHolder: "head:after",
aoColumns: [{ type: "text" },
{ type: "text" },
{ type: "text"}]
});
}
</code></pre>
<ol>
<li><p>i have use js to maitain the scroll position for this gridview</p>
<pre><code> var totalRows = $("#<%= gvTransactionType.ClientID %> tr").length;
alert( totalRows );
var xPos, yPos;
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
//Get x and y position of scrollbar before partial postback
xPos = $get('scrollDiv').scrollLeft;
yPos = $get('scrollDiv').scrollTop;
}
function EndRequestHandler(sender, args) {
//Set x and y position back to the scrollbar after partial postback
$get('scrollDiv').scrollLeft = xPos;
$get('scrollDiv').scrollTop = yPos;
}
</code></pre>
<p>So any one can say how to handel this.</p></li>
</ol>
<p>Thank You</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
2,515,927 | 2,515,928 |
how to restore the previous page on browser back button Click?
|
<p>how to restore the previous page on browser back button Click, i don't need reload the page, just restore it. I notice the url changed, but not the content? I am using master page.</p>
|
c# asp.net
|
[0, 9]
|
559,656 | 559,657 |
Could Not Write File on FTP server using FTPClient in Java
|
<p>I am reading files on a FTP server and writing that data into another file. But after properly reading the data I couldn't write the file on to the FTP server.</p>
<p>I can retrieve files using "retrieve file", but can not store file using the <code>storefile</code> function.</p>
<p>My code is:</p>
<pre><code>import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
public class FtpDemo {
public static void main(String args[]){
FTPClient client=new FTPClient();
try {
if(client.isConnected()){
client.disconnect();
Boolean isLog=client.logout();
System.out.println(isLog);
}
client.connect("server");
Boolean isLogin=client.login("user","password");
if(isLogin){
System.out.println("Login has been successfully");
FTPFile[] files=client.listFiles();
System.out.println("Login has been successfully"+files.length);
for(int i=0;i<files.length;i++){
if(files[i].getName().equals("rajesh.txt")){
System.out.println("match has been successfully");
InputStream is=client.retrieveFileStream("/rajesh.txt");
BufferedReader br=new BufferedReader(new InputStreamReader(is));
String str;
String content="";
str=br.readLine();
while(str!=null){
content+=str;
str=br.readLine();
}
System.out.println(content);
Boolean isStore=client.storeFile("/rajesh.txt",is);
System.out.println(isStore);
}
}
}
}
catch(Exception e){
System.out.println(e.getMessage());
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
83,468 | 83,469 |
JQuery Animation Question
|
<p>I have created a jquery animation that can be seen by clicking the <strong>Preview</strong> button on top:</p>
<p><a href="http://jsbin.com/anayi3/edit" rel="nofollow">http://jsbin.com/anayi3/edit</a></p>
<p>I have used the <code>slideDown</code> animation method. The problem is that all items slide down together. I want to each number to display after short delay. It should not be much of problem for experienced jquery developers.</p>
<p>How to do that?</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
5,176,340 | 5,176,341 |
Read XLS file in memory ASP.Net
|
<p>I have an xls file sitting in a byte[] as a result of a file upload on my asp.net web application. Is there a library that can read in and process the xls file as a byte[]? I do not want to save the file to disk. </p>
<p>All I need to do is be able to read the cell contents (I would prefer to accept csv file if I had the choice). </p>
<p>I discovered SpreadsheetGear which claims to do this, but I would rather not pay $1000 for software that does way more than I need it to.</p>
<p>Note that I am referring to XLS file and not XLSX file, but I would appreciate advice on both. </p>
|
c# asp.net
|
[0, 9]
|
441,247 | 441,248 |
How to pass the textbox value in jquery autocomplete
|
<p>I'm using jquery autocomplete in some textboxes in my web application (.Net 3.5). My problem is the prefix text is always blank. The correct value won't be assigned to it.</p>
<pre><code>function TextBoxAutoComplete(scope, controlId, contextKeyId) {
var txtbox = null;
var flagValue;
if (scope) {
txtbox = $('input[id$="' + controlId + '"]', scope);
} else {
txtbox = $('input[id$="' + controlId + '"]', document);
}
var contextKeyValue = $('input[id$="' + contextKeyId + '"]', document).val();
$(txtbox).autocomplete("../Handlers/MiscHandler.ashx", {
minChars: 0,
extraParams: { prefixText: $(this).val(), count: '10', contextKey: contextKeyValue, flag: 'codePart' },
selectFirst: false,
width: 49
}).result(function(event, data, formatted) { // result is a separate function
var dummy = new Object();
dummy.value = data[1];
dummy.text = data[0];
var test = new Test(dummy);
});
}
</code></pre>
<p>I call the above method at document ready. Here the problem is I don't get the textbox value (currently typed text) when i pass it to the variable 'prifixText'
<strong>prefixText: $(this).val()</strong></p>
<p>Can anyone please help me in solving this issue? Thanks</p>
|
c# javascript jquery
|
[0, 3, 5]
|
5,898,518 | 5,898,519 |
Outputting Javascript from PHP, but Javascript doesn't get executed
|
<p>The PHP script doesn't seem to call <code>dis();</code> function..Here it is:</p>
<p>PHP:</p>
<pre><code>if (!$_SESSION['user']) {
echo"<script type='text/javascript'>dis();</script>";
}
</code></pre>
<p>JS:</p>
<pre><code> <script type="text/javascript">
function dis() {
$(document).ready(function() {
$("#main_text_area").attr("disabled", "disabled");
});
}
</code></pre>
<p>When I place just <code>$("#main_text_area").attr("disabled", "disabled");</code> it disables correctly...but I need to do it on a function call...Thanks for comments.</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,825,698 | 1,825,699 |
Dynamic table with multiple datepickers
|
<p>I have a web form which has dynamic table using repeating rows. New rows are added by calling the addRow function below:</p>
<pre><code>function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var colCount = table.rows[0].cells.length;
for(var i=0; i<colCount; i++) {
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[0].cells[i].innerHTML;
//alert(newcell.childNodes);
switch(newcell.childNodes[0].type) {
case "text":
newcell.childNodes[0].value = "";
break;
case "checkbox":
newcell.childNodes[0].checked = false;
break;
case "select-one":
newcell.childNodes[0].selectedIndex = 0;
break;
}
</code></pre>
<p>I would like one datepicker (or more) in each row. Datepicker from here:
<a href="http://www.frequency-decoder.com/2011/10/11/unobtrusive-accessible-datepicker-widgit-v6" rel="nofollow">http://www.frequency-decoder.com/2011/10/11/unobtrusive-accessible-datepicker-widgit-v6</a></p>
<p>I need the following script for each datepicker:</p>
<pre><code><script>
datePickerController.createDatePicker({
// Associate the text input to a DD/MM/YYYY date format
formElements:{"formInputName":"%Y-%m-%d"}
});
</script>
</code></pre>
<p>How can I easily execute this script for each table row that is added? I'm aware that using in innerHTML does not work. Please see the attached image for the desired result.</p>
<p><img src="http://i.stack.imgur.com/sDq1p.jpg" alt="http://i.stack.imgur.com/HHn2w.jpg"></p>
<p>Thanks for your help!</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,906,811 | 5,906,812 |
how to read item template field in c#
|
<p>I have one dropdown box inside the item template. As per of my requirement I need to update the tooltip field of drop down in aspx.cs page.</p>
<p>I use the following code:</p>
<pre><code><asp:TemplateField HeaderStyle-CssClass="grid-label-small" HeaderText="*State">
<ItemTemplate>
<asp:DropDownList ID="ddlDefState" Width="110px" runat="server" ToolTip="Select State">
</asp:DropDownList>
</ItemTemplate>
<HeaderStyle CssClass="grid-label-small" />
</asp:TemplateField>`.
</code></pre>
<p>Thank you...</p>
|
c# asp.net
|
[0, 9]
|
5,221,696 | 5,221,697 |
Use JavaScript to prevent spacebar?
|
<p>I have a live search on a site I'm developing. At the moment, it searches the MySql database after the first character is typed, and updates the search for each new character. When <kbd>Space</kbd> is pressed as the first character, it displays all entries in the database. I don't want it to do that. I have the following code that I found somewhere that prevents the <code>SPACE</code> character from being typed:</p>
<pre><code>$('input[type="text"]').keydown(function(e){
var ignore_key_codes = [8,32];
if ($.inArray(e.keyCode, ignore_key_codes) >= 0){
e.preventDefault();
}
});
</code></pre>
<p>This does what it's meant to do, but not exactly what I want. This will prevent the space bar from working in the text input at all, what I require is that it only prevents the space bar if it's the first character being typed. For example, typing " apples" would prevent the space, but typing "apples oranges" wouldn't. </p>
<p>Is there anything I can try to achieve this?</p>
|
php javascript
|
[2, 3]
|
3,168,774 | 3,168,775 |
Select box in php not getting the selected value in jQuery
|
<p>I have a select box like </p>
<pre><code><select id="addressbook_user" name="addressboook_user">
<?php
$asql = "SELECT * from demo_addressbook WHERE user_created_id IN(SELECT id FROM demo_user WHERE user_name = '$get_user_name') AND type = 1 ";
// $result = mysql_query($query);
// mysql_real_escape_string($asql);
$aresult = mysql_query($asql) or die (mysql_error());
while($arow_list=mysql_fetch_assoc($aresult)){
?>
<option value="<?php echo $arow_list['guest_name']; ?>"><?php echo $arow_list['guest_name']; ?></option>
<?php
}
?>
</select>
</code></pre>
<p>Here is my jQuery code to get this value .</p>
<pre><code>function save() {
alert($("#addressboook_user").val());
var selectVal = $('#addressboook_user :selected').val();
alert(selectVal);
var user = $("#addressboook_user").val();
}
</code></pre>
<p>My question is when select box has a selected value then why my jQuery code alert is always showing undefined ?</p>
<p>please help me out here really got frustrated .</p>
|
php jquery
|
[2, 5]
|
331,559 | 331,560 |
all validators executed when page is loaded
|
<p>Can i run all validators when page is loaded. I need to show * in all input text fields that are necessary. I have require field validators for that fields, can i run it by default when page is loaded?</p>
|
c# asp.net
|
[0, 9]
|
3,209,345 | 3,209,346 |
PHP or Javascript date and time code from both server and local time
|
<p>Does anybody have a simple code for showing week nr, date and time taken from the webserver?</p>
<p>And then another code that gets the time from the local computer?</p>
<p>I'm looking for a JS or PHP code</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,226,151 | 3,226,152 |
how to convert text file to xml
|
<p>I want to convert the <code>text file</code> into <code>xml file</code>.I have a large amount of string but i dont want to write in xml directly.</p>
<p>So that I have made a text file now i want to convert this </p>
<p>text file into xml format but when i am running this file getting no output. here is my </p>
<p>code:</p>
<pre><code>public void convert() throws Exception {
String text[]=new String[10];
FileOutputStream fout = new FileOutputStream("res/values/mysml.xml");
OutputStreamWriter out = new OutputStreamWriter(fout);
InputStream in= getAssets().open("myText.txt");
Scanner scn = new Scanner(is);
for(int i=0;i<10;i++)
text[i]=bin.readLine();
out.write("<?xml version=\"1.0\"?>\r\n");
out.write("<resources>\r\n");
for (int i = 0; i < 10; i++){
out.write("<item>"+text[i]+"</item>");
}
out.write("</resources>");
out.flush();
out.close();
</code></pre>
<p>}</p>
|
java android
|
[1, 4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.