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,269,129 | 5,269,130 | How to focus radio button? | <p>I want to focus in radio button used grouping in grid view. Now I write some code that is:</p>
<pre><code>error = ((RadioButton)gridview1.rows[3].FindControl("radio1")).ClientID;
RunScriptBottom("DoFocus()","DoFocus");
</code></pre>
<p>That code is called in a JavaScript function</p>
<pre><code>function DoFocus(){
document.getElementById("<%=error%>").focus();
}
</code></pre>
<p>But that code has a JavaScript error. How should i do this?</p>
| c# javascript | [0, 3] |
4,015,685 | 4,015,686 | Change filename on file upload in .net (asp) | <p>How to change file name on upload ?</p>
<p>I have such code :</p>
<pre><code><%@ WebHandler Language="C#" Class="Upload" %>
using System;
using System.Web;
using System.IO;
public class Upload : IHttpHandler {
public void ProcessRequest(HttpContext context) {
HttpPostedFile oFile = context.Request.Files["Filedata"];
string newFileName1 = HttpContext.Current.Server.MapPath(@context.Request["orderID"]);
string newFileName2 = HttpContext.Current.Server.MapPath(@context.Request["productCombinationString"]);
string newName;
if(newFileName2 != "" && newFileName2 != null && newFileName2 != "<!--@Ecom:productCombinationString-->") {
newName = newFileName1 + newFileName2 + oFile.ContentType;
} else {
newName = newFileName1 + oFile.ContentType;
}
string sDirectory = HttpContext.Current.Server.MapPath(@context.Request["folder"]);
oFile.SaveAs(sDirectory + "/" + oFile.FileName);
if (!Directory.Exists(sDirectory)) Directory.CreateDirectory(sDirectory);
context.Response.Write("1");
}
public bool IsReusable {
get { return false; }
}
}
</code></pre>
<p>And if i change oFile.Filename to newName it does not work ... what is the problem ? :)
Thank you</p>
| c# asp.net | [0, 9] |
983,702 | 983,703 | Accessing image tag id in javascript when it is placed inside asp server control, Error:The server tag is not well defined | <p>I have code as shown below</p>
<pre><code> <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
HeaderStyle-CssClass="Column1">
<ItemTemplate>
<div class="Column1" style="visibility:<%# SetEditImagesVisibility()%>;">
<img src="" id="iEdit" alt="Edit" class='btntransparent' onclick="EditQC('<%#Eval("ID") %>')" />
<img src="" id="iDelete" alt="Delete" class='btntransparent' onclick="DeleteQ('<%#Eval("ID") %>')" />
</div>
</ItemTemplate>
<HeaderTemplate>
<div style="visibility:<%# SetAddImagesVisibility()%>;">
<img src="" alt="Add" class='btntransparent' id="iPlus" runat="server" onclick="AddTestingID()" />
</div>
</HeaderTemplate>
</asp:TemplateField>
</code></pre>
<p>Here i need to access img tag id in javascript(iEdit and iDelete) but am getting error as
The Server tag is not well defined
javascript code is shown below</p>
<pre><code> document.getElementsById('iEdit').src = HostedPath + 'pics/edit.gif';
document.getElementsById('iDelete').src = HostedPath + 'pics/edit.gif';
</code></pre>
<p>Any one please help me out in fixing this issue.
Thanks in advance</p>
| javascript asp.net | [3, 9] |
2,634,928 | 2,634,929 | Alert based on if condition error | <p>I am trying to fire an alert based on wether a flag is set or not. The first time the page is loaded, the alert works fine. If I then alert data after success, then when I close the dialog the old data is still there. So instead of seeing no data, I still see the old data. The idea, is that if user closes the dialog without doing anything, then the else statement is triggered. I would be grateful if someone could help with this. many thanks</p>
<pre><code>var box;
var status;
var size;
var flag;
beforeclose: function (event, ui) {
if(flag==1){
jAlert("You have successfully editted\n\rBox: "+box+"\n\r"+
"Status: "+status+"\n\r"+
"Size: "+size+"\n\r", 'Box addittion successfull');
}
else{
alert("no data");
}$("#f2").html("");
}
success: function (data) {
flag = 1;
$("#EB_edit").get(0).reset();
$('#f2').html(data);
//$("#form").dialog('close');
$("#flex1").flexReload();
}
</code></pre>
| javascript jquery | [3, 5] |
257,665 | 257,666 | How to run stored procedure from code behind | <p>i am inserting some values in my table and at the same time, i want to call stored procedure that does some updates but i am having some issues with the syntax. I have searched online but could not find anything. I am just trying to figure out how can to use the same connection. here is my code:</p>
<pre><code>sqlcmd.CommandText = "INSERT INTO MyTable(ID, Name ) VALUES(@ID, @Name)";
sqlcmd.Parameters.Clear();
sqlcmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = ID;
sqlcmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = Name;
sqlcmd.Connection = sqlcon;
sqlcmd.ExecuteNonQuery();
</code></pre>
<p>i saw some example on the internet but was not able to figure out how to use the same connection.
here is the example i found:</p>
<pre><code>SqlCommand myCMD = new SqlCommand("sp_Test", sqlcon);
myCMD.CommandType = CommandType.StoredProcedure;
</code></pre>
| c# asp.net | [0, 9] |
1,979,273 | 1,979,274 | OnClick event calling a js function and a callback function | <p>I have an external compiled project(asp.net) that we are using in our code. I dont have access to the code behind, just the .aspx pages.</p>
<p>One of the things Im trying to do is to call two functions from the button in the page.</p>
<pre><code><cc1:ImageButton ID="btnYes" runat="server" OnClick="btnYes_Click" Text="Yes"
Width="40px" SkinID="DefaultButton" />
</code></pre>
<p>Is there a way I can add a JS function and let the OnClick event call both btnYes_Click and my JS function?
something like this? <code>OnClick="btnYes_Click ; myfunction();"</code></p>
<p>I dont have any access to the code behind page.</p>
| javascript asp.net | [3, 9] |
3,282,916 | 3,282,917 | ASP.NET javascript embed in template column | <p>I am developing a web page in which a rad grid displays the list of exams. I included a template column which shows count down timer when the exam is going to expire.</p>
<p>Code is as given below:</p>
<pre><code> <telerik:RadGrid ID="radGrid" runat="server" AutoGenerateColumns="false">
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn HeaderText="template" DataField="Date">
<ItemTemplate>
<script language="JavaScript" type="text/javascript">
TargetDate = '<%# Eval("Date") %>';
BackColor = "white";
ForeColor = "black";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js" type="text/javascript"></script>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</code></pre>
<p>I am giving DataTable as datasource to this grid. But my problem is , the template column is showing data only for the first record and the value taken is from the last row in the DataTable.</p>
<p>For Ex: If I give data as given below, I can see 3 records but with only the first record displaying the counter with last value(<code>10/10/2010 05:43 PM</code>).</p>
<pre><code>02/02/2011 01:00 AM
08/09/2010 11:00 PM
10/10/2010 05:43 PM
</code></pre>
<p>Could you please help in this??</p>
<p>Thanks,
Mahesh</p>
| asp.net javascript | [9, 3] |
976,270 | 976,271 | How to store search result? | <p>I am working on my personal site, where I want to <strong>store my customers recent search</strong> result limited to that <strong>particular session</strong>. </p>
<p>I am using <strong>PHP</strong> platform and <strong>Javascripts</strong>.</p>
<p><a href="http://www.networksolutions.com/domain-name-registration" rel="nofollow">Here</a> <strong>is an example</strong> of what I am exactly looking at :</p>
<p>It <strong>stores</strong> your <strong>previously searched domain</strong> name for that <strong>particular session</strong> so that user can make decision by comparing those results.</p>
<p>Thanks.</p>
<p><strong>EDIT-</strong> Well Thanks for all of your answers and suggestions.</p>
<p>But If you have noticed
<a href="http://www.networksolutions.com/domain-name-registration" rel="nofollow">above example</a></p>
<p>It looks like some kind of script <strong>loading a new content</strong> on the <strong>same page</strong> without <strong>refreshing</strong> it and <strong>keeping previous search content</strong> <code><div></code> as it is.</p>
<p>How to achieve this using <strong>javascripts or some sort of div layer</strong> ????</p>
| php javascript jquery | [2, 3, 5] |
1,686,970 | 1,686,971 | Reset setTimeout every button click? | <p>Here is My Code</p>
<blockquote>
<p>var sec = 10 var timer = setInterval(function() {<br>
$('#timer span').text(sec--);
}, 1000);</p>
</blockquote>
<p>it setTimeout for 10seconds and if I click reset button will setTimeout again with 10seconds</p>
| javascript jquery | [3, 5] |
2,545,528 | 2,545,529 | setting value of textbox using javascript in asp.net | <p>i am using .aspx page where i used html textarea to get the teat from user.
i am also have a asp:textbox say "txtbox1" control where i want to have the value of that textarea in txtbox1. but it is not setting the value..
i am using javascript as:</p>
<pre><code> document.getElementById('txtareahead').readOnly= true;
document.getElementById('txtareahead').innerHTML=document.getElementById('txtareahead').value;
document.getElementById(’<%= txtbox1.ClientID %>’).value = document.getElementById('txtareahead').value;
</code></pre>
<p>how can i set the value of asp:textbox using javascript..</p>
| javascript asp.net | [3, 9] |
3,934,760 | 3,934,761 | Setting an attribute to the last position | <p><strong>Is it possible to set a new attribute to the last position of a html element using javascript/jQuery?</strong></p>
<p>This would be helpfull for me in a case where the attribute order is important to decide whether the paragraph has changed or not.</p>
<p><strong>Example:</strong></p>
<pre><code><p attribute1="true" attribute2="true">
</code></pre>
<p>Now, i would like to add a third attribute so that the resulting paragraph would look like</p>
<pre><code><p attribute1="true" attribute2="true" attribute3="true">
</code></pre>
| javascript jquery | [3, 5] |
242,902 | 242,903 | Script not executing on homepage | <p>I'm using the following code to evaluate two sets of conditions in a CMS generated navigation list on a site I'm building:</p>
<p>Condition one: if there's an ampersand in the navigation, surround it with em tags.</p>
<pre><code>//pretty ampersands for all! Well, just the H1 tags and the navigation.
$("nav a:contains('&'), h1:contains('&'), nav li:contains('&')", document.body)
.contents()
.each(
function() {
if( this.nodeType == 3 ) {
$(this)
.replaceWith( this
.nodeValue
.replace( /&/g, "<em>&</em>" )
);
}
}
);
</code></pre>
<p>Condition two: if the number of characters in a li or a element exceed 20 characters, wrap the text so that the image set to display on hover and after won't jump to the next line.</p>
<pre><code> //if a submenu link is more than 20 characters long, resize that baby so the hover leaf won't jump.
$('nav li ul li a, .active').each(function() {
var curr = $(this).text().length;
if(curr >= 20){
$(this).css({'width':'90px','text-indent':'-1em','margin-left':'1em'});
}
});
</code></pre>
<p>For no apparent reason, neither of these conditions are being tested for or executed on the homepage. The script work fine on all interior pages. (though not in IE7, for reasons I have yet to figure out) I can't see any difference between the code on the separate pages that would account for this disparity. Help?</p>
<p><a href="http://www.qualprnt.com/clients/smca/" rel="nofollow">The live site can be viewed here.</a></p>
| javascript jquery | [3, 5] |
3,859,300 | 3,859,301 | GridView inside a ViewPager | <p>I can't swipe/move to next page without me putting my finger to an empty space in the gridview, anyone encountered this?</p>
| java android | [1, 4] |
5,616,486 | 5,616,487 | What jquery experssion would give me ['a','b'] for the doc <tag att1='a' /><tag att1='b'/> | <p>What jquery experssion would give me <code>['a','b']</code> for the doc <code><tag att1='a' /><tag att1='b' /></code>.</p>
<p>Even though the question seems straight forward enough, I've added more info here to pass the automated quality standards on the question submission form.</p>
<p>The actual case I'm working on is to list an array of all the images used in an html doc (not the tags, but the actual locations of the images). So the desired result will be something like <code>["http://mywebsite.com/path_to_image_1.jpg", ...]</code> for a document that contains snippets like:</p>
<pre><code><img src="http://mywebsite.com/path_to_image_1.jpg" />
<img src="http://mywebsite.com/path_to_image_2.jpg" />
</code></pre>
<p>I really don't want to have to list all the tags, then iterate manually to get the src attribute.</p>
| javascript jquery | [3, 5] |
4,295,619 | 4,295,620 | Removing <script> tag - PHP | <p>How to change all the occurrence of the <code><script> <Script> <scRipT> <sCrIpT> and so ..</code> to <code>&lt;script&gt; &lt;Script&gt;</code> with PHP<br>
I also want to remove </p>
<p>The input will be taken from a WYSIWYG Editor, so i can not use the strip_tags function.</p>
<p><code>Edit 2</code><br>
Is there any other way a user can execute a javascript with some kind of strange characters to<br>
I found this on internet </p>
<pre><code><scr<!--*-->ipt>
alert('hi')
</script>
</code></pre>
<p>But it did not worked though, is there any such possibilities ?</p>
| php javascript | [2, 3] |
1,432,528 | 1,432,529 | Way to know what Windows service pack version is from the browser? | <p>Is there a way to find what service pack is installed from the browser? It doesn't look like it's in the System.Web.HttpBrowserCapabilities in asp.net. I need a way to warn users that they need to update to XP Service Pack 3 before proceeding and installing some software.</p>
| javascript asp.net | [3, 9] |
3,824,025 | 3,824,026 | Show list of partial news items as a hyperlink so the user can click 'read more' | <p>I need to create a Vertical Ticker news scroller which gets populated dynamically from the code behind using C# ( asp.net ) by taking the records from a MSSQL database.</p>
<p>I see a similar article but its in PHP ( See Below )
<a href="http://stackoverflow.com/questions/3352943/automatically-insert-content-into-news-section">Automatically insert content into News section</a></p>
<p>I have googled and boogled and Goggled and searched but cant find exactly what I need.</p>
<p>If anyone could help me out by helping me to populate a dynamic list of hyperlinks or partial event descriptions with a '..Read More!' kind of link at the end Id appreciate it.</p>
<p>My SQL table has :</p>
<p>EventID
EventName
EventDescription
StartTime
Date
Other</p>
<p>So the ideal approach would be to scroll the event names vertically and if the name is too big to truncate it and have a 'read more' link so I can bring the user to another page where I can display the full record based on the link/event they click to the EventID from the table ...</p>
<p>Phew... :)</p>
<p>Any help would be appreciated everyone.. Many Thanks!!!!</p>
| c# asp.net | [0, 9] |
3,410,702 | 3,410,703 | How to invoke ondeletecommand of a DataList inside another | <p>I have a datalist containing usercontrol placed in update panel, any of these usercontrols may contain a datalist.I'm trying to fire ondeletecommand of the inside datalist but nothing happens.Any clue</p>
| c# asp.net | [0, 9] |
2,927,835 | 2,927,836 | Save jQuery variables in a PHP session | <pre><code>var x = e.pageX;
var y = e.pageY;
</code></pre>
<p>Which is the easiest way to save those jQuery variables in a PHP session.</p>
| php jquery | [2, 5] |
1,903,856 | 1,903,857 | javascript - get Object based on property's value | <p>... if I have the following constructor and then create an instance of the class:</p>
<pre><code> /* Gallery */
function Gallery( _horseName ){
this.horseName = _horseName
this.pixList = new Array();
}
var touchGallery = new Gallery( "touch" )
</code></pre>
<p>... how can I get the Gallery object based on the value of horseName?</p>
<p>Thought about implementing something like: </p>
<pre><code>Gallery.prototype.getGalleryByHorseName = function( _horseName ){ /* to be implemented */}
</code></pre>
<p>... but got stuck on that. Is there a cleaner or canonical way to accomplish this? Eventually I'll have to access that Gallery object in jQuery as well.</p>
<p>Thanks in advance</p>
| javascript jquery | [3, 5] |
847,461 | 847,462 | Connecting to MySql through ASP.NET using ODBC | <p>help me with this issue please.</p>
<p>I'm trying to connect to MySql using ASP.Net.
i'm using this code to do this:</p>
<pre><code>using System.Data;
using System.Data.Odbc;
//......
DataSet Mysql_ds = new DataSet();
OdbcConnection Mysql_con;
string Mysql_conStr = "Driver={MySQL ODBC 4.1 Driver};Server=SERVERNAME;Database=DBNAME;uid=USER;pwd=PASS";
Mysql_con = new OdbcConnection(Mysql_conStr);
Mysql_con.Open();
//....
</code></pre>
<p>this code works well when i use it in C#, WindowsFrom Application, BUT When I use this code in ASP.NET and upload it to my server, when i go to my website address, i get this error :</p>
<p><strong>Exception Details:</strong> System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified</p>
<p>the error line is in the last line ( Mysql_con.open() ).</p>
<p>I have searched a lot and do some tries but nothing solved yet :(
How should I solve this problem!
OR
Is there any better way to create mysql connection !?</p>
<p>here is some information about the MySql installed on the server site :</p>
<p>localhost:
Server version: 4.1.22-community-nt
Protocol version: 10
Server: localhost via TCP/IP
User: [email protected]</p>
<p>phpMyAdmin - 2.10.1:
MySQL client version: 5.0.45
Used PHP extensions: mysql</p>
| c# asp.net | [0, 9] |
3,454,116 | 3,454,117 | Javascript function can write to console but not returning value | <p>I have a function in javascript which can write the output to the console but it is unable to return the value.. </p>
<pre><code>fetchData: function(dateToFetch){
if (mP.viewMode == 1){
$.each(mealData.DailymPs, function(k, item){
if( item.Date == formatDate(mP.chosenDate) ){
mP.DayPlan.mPDayData = item;
return mP.populateMealDayPlan();
}
})
} else if (mP.viewMode == 2){
// debugger;
$.each(mealData.DailymPs, function(k, item){
if( item.Date == (dateToFetch) ){
mP.DayPlan.mPDayData = item;
console.log(mP.populateMealDayPlan());
var returnObj = mP.populateMealDayPlan();
return returnObj;
}
})
}
}
</code></pre>
| javascript jquery | [3, 5] |
2,064,074 | 2,064,075 | Dynamically load user controls on button click, postback issue | <p>I'm trying to load usercontrols on button click, but problem is that, it disappears on postback inside user control.</p>
<p>this is how i load controls:</p>
<pre><code>private bool IsUserControl
{
get
{
if (ViewState["IsUserControl"] != null)
{
return (bool)ViewState["IsUserControl"];
}
else
{
return false;
}
}
set
{
ViewState["IsUserControl"] = value;
}
}
#region Usercontrols
private void CreateUserControlAllNews()
{
Control featuredProduct = Page.LoadControl("path/usercontrol.ascx");
plh1.Controls.Add(featuredProduct);
}
#endregion
protected void allNewsbtn_Click(object sender, EventArgs e)
{
this.IsUserControl = true;
if(IsUserControl)
CreateUserControlAllNews();
}
</code></pre>
| c# asp.net | [0, 9] |
1,621,771 | 1,621,772 | asp.hyperlink in gridview Format 0 as null | <p>I am calling a giant stored proc via linq to sql that brings back some numbered data from 0 to 9. I would like to be able to display any zeros as nulls (so there is no hyperlink). I could do this in my stored procedure, but it would make it really hard to read and maintain (there is a lot of case logic going on).</p>
<p>I have the following code linking my procs results to the linqdatasource. Is there a way to update all records by formatting the data before binding or after the fact on the hyperlink?</p>
<pre><code>protected void LinqMainMenu_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
var db = new App_Data.MYAppDataContext();
e.Result = db.sp_MainMenuTest( (Int16)Session["myid"]);
}
</code></pre>
<p>Thanks</p>
| c# asp.net | [0, 9] |
3,252,200 | 3,252,201 | plotting X Y notes and creating edges between them in javascript | <p>I am looking for a javascript library that I can do following:</p>
<p>Create X,Y nodes
Create Edges between X,Y nodes
add Label to Nodes</p>
<p>I have looked at infovis and d3.js. Both do node and edges but I cannot seem to find how I can define the X,Y of each node.</p>
| javascript jquery | [3, 5] |
4,372,132 | 4,372,133 | Get the current page number using turn js | <p>I am using turn js , a js that create flip book function. </p>
<p>From the online source the statement to get current page is :</p>
<pre><code>alert($('selector').turn('page'));
</code></pre>
<p>However, it only get a null value that means the $('selector').turn('page') is not working. How to get the page no of the user reading page. Since a book have 2 page at the same time, I would like to get the page either left hand side or right hand side, How to do this ? Thanks </p>
| javascript jquery | [3, 5] |
4,630,096 | 4,630,097 | window.opener.doccument.getelementbyid() is not working when popup from iframe | <p>I am calling a popup from an iframe and when I click a button the popup should close and show a message in parent iframe. I am using the javascript below</p>
<pre><code>function ClosePopup() {
var fRame = window.opener.document.getElementByID('lblMessage').innerHTML="testMessage";
self.close();
}
</code></pre>
<p>However, when I execute this, an error is returned : <code>getelementbyid is null</code>.</p>
<p>How can I show a message in the parent iframe. Can anyone help me?</p>
| javascript asp.net | [3, 9] |
5,004,589 | 5,004,590 | Swipeview - show preview/snippet of next item? | <p>I am using Swipeview (http://cubiq.org/swipeview) to create a touch-enabled carousel working on an iPhone and Android. The basics works great.</p>
<p>My problem starts when i try to get it to show 25% of the next slide pr default. The idea is that the user can see 1/4 of the next slide/image, which should then make them slide the image to reveal the next slide/image. The first image then disapears, the second image becomes 100% vissible, aligned to the left, and the 3rd image is then vissible by 1/4. And so on.</p>
<p>I trid changing the <code>div.style.cssText</code> (in swipeview.js) to have a width of <code>75%</code> instead of the default <code>100%</code>. This works for the initial load, but when i scroll, the part of the 2nd image that was vissible on slide 1, is now hidden on slide 2.</p>
<p>I made a fiddle to demonstrate: <a href="http://jsfiddle.net/zeqjN/1/" rel="nofollow">http://jsfiddle.net/zeqjN/1/</a> (test it in Chrome and try dragging the image to the left)</p>
<p>Any ideas as to how i can modify Swipeview.js to fit my needs?</p>
| javascript jquery | [3, 5] |
2,747,789 | 2,747,790 | Error : Could not find HelloAndroid.apk | <p>I am very new to Android development. I followed every steps from developer.com to install ADK. Now my issue is, when I tried to run HelloAndroid application, I get an error as I mentioned in the title.
I hav JRE1.6 installed. Is tat enuf? Because I read tat ether jdk or jre is ok. I am clearly blank about the concept of this apk error. And I am using Eclipse Ganymede. Kindly give a solution for my issue. Thank You. :)</p>
| java android | [1, 4] |
5,896,167 | 5,896,168 | jQuery Floating Div with Bottom Limit | <p>Trying to duplicate the mashable effect with two menus. I got the scrolling effect working, but I was looking for the effect to stop at the top of the footer. I was thinking I could do a conditional statement with the limits, but I wasn't sure how to pull it off.</p>
<p>Here is the javascript I'm using.</p>
<pre><code>var name = ".floater";
var menuYloc = null;
jQuery(document).ready(function($) {
menuYloc = parseInt(jQuery(name).css("top").substring(0,jQuery(name).css("top").indexOf("px")))
jQuery(window).scroll(function () {
offset = menuYloc+jQuery(document).scrollTop()+"px";
jQuery(name).animate({top:offset},{duration:500,queue:false});
});
});
</code></pre>
<p>Here is the link to the build site. <a href="http://host.philmadelphia2.com/~chill/about/" rel="nofollow">http://host.philmadelphia2.com/~chill/about/</a></p>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
2,606,592 | 2,606,593 | RNG hidden field parameter | <p>I have a registration form and I am taking the users input and passing the information to a payment website. The payment website has several hidden fields so it can distinguish each individual user as unique instead of relying on a unique name provided by the user. That's what the "unique_id" field is and I want a random number to be the parameter. How would I make this work so every time a user clicks the button that this code is attached to, it executes the RNG and passes that number to the external payment website?</p>
<p>...</p>
<pre><code> protected void submitButton_Click(object sender, EventArgs e)
{
Random randnum = new Random();
int num = randnum.Next();
{
NameValueCollection PostFields = new NameValueCollection();
PostFields.Add("LMID", "345573");
PostFields.Add("unique_id", RANDOM NUMBER HEEDS TO GO HERE);
PostFields.Add("sTotal", "150.00");
PostFields.Add("webTitle", "Conference");
PostFields.Add("Trans_Desc", "Conference Registration");
PostFields.Add("contact_info", "Contact admin");
PostFields.Add("BILL_CUSTOMER_FIRSTNAME", labelFirstName.Text);
PostFields.Add("BILL_CUSTOMER_LASTNAME", labelLastName.Text);
PostFields.Add("BILL_ADDRESS1", labelAddress.Text);
PostFields.Add("BILL_CITY", labelCity.Text);
PostFields.Add("BILL_STATE", labelState.Text);
PostFields.Add("BILL_ZIP", labelZip.Text);
PostFields.Add("BILL_CUSTOMER_PHONE", labelTelephone.Text);
PostFields.Add("BILL_CUSTOMER_EMAIL", labelEmail.Text);
RedirectAndPOST(this.Page, "payment website url", PostFields);
}
</code></pre>
<p>...</p>
| c# asp.net | [0, 9] |
5,890,314 | 5,890,315 | "sexiest" libraries for content presentation | <p>maybe someone will classify this question as "subjective..." but i think it would be useful to have a place where put links to fancy jquery and non-jquery libraries for high impact content presentation ... can you list here your favorite? I'm interested in using it for a project for which i would like to amaze my customer.
Thanks in advance and greetings.
c.</p>
<p>[thanks for closing post ... i was simply looking for links like this: <a href="http://miniajax.com/" rel="nofollow">http://miniajax.com/</a>]</p>
| javascript jquery | [3, 5] |
868,937 | 868,938 | How to call a javascript function and get the html code it returns ,Java,Android | <p>There is a HTML page that has a javascript function in it.This function returns a frame with a random picture.
Is there a way to call this function and get the HTML code that is hidding? (So i get the image)</p>
<p>Exactly i want to get a html stream from <a href="http://partner.googleadservices.com/gampad/google_service.js" rel="nofollow">GoogleServices.js</a>
by calling:</p>
<pre><code>GS_googleAddAdSenseService("ca-pub-YOU
RPUBIDHERE");
GS_googleEnableAllServices();
GA_googleAddSlot("ca-pub-YOURPUBIDHERE", "ADSLOT_NAME_HERE");
GA_googleFetchAds();
GA_googleFillSlot("ADSLOT_NAME_HERE");
</code></pre>
| java javascript android | [1, 3, 4] |
4,723,217 | 4,723,218 | objectdatasource question | <p>For the moment, I'm binding my gridviews by calling a linq query that returns a list collection of objects MyObject. In my gridview, if I'm using a boundfield I set its Datafield property to the name of the property of MyObject and if I'm using an itemtemplate I work with Eval. In my code behind, I have</p>
<pre><code>MyGridview.DataSource = MyListOfMyObject;
MyGridview.DataBind();
</code></pre>
<p>All seems to work fine.</p>
<p>What's the purpose of adding an ObjectDataSource control in the aspx file. What does it do extra?</p>
<p>Thanks.</p>
<p>PS: I'm new to the .net framework and I'm still figuring things out. </p>
| c# asp.net | [0, 9] |
2,455,006 | 2,455,007 | How to prevent repeated text field input within the same Form. | <p>I am creating a e-commerce website. In my website people can register and share their recipe. And in that recipe Form i have multiple text fields. Such as Recipe name, Ingredients, cooking time, cooking tools etc.Now anyone can just change the recipe name and send the same content over and over again to flood the database.My question is now: How can i prevent repeated text filed input within the same Form?" </p>
| php javascript | [2, 3] |
4,265,029 | 4,265,030 | JQUERY Multiple ID selectors | <p>Heres a snip of the start of my code </p>
<pre><code> var myUpload = $("#upload_link").upload({bla bla bla
</code></pre>
<p>Basically what I'm trying to do is make the same call with a few different ID's...</p>
<p>I would have assumed this would work but it doesn't :</p>
<p>example :</p>
<pre><code> var myUpload = $("#upload_link,#upload_link2,#upload_link3").upload({
</code></pre>
<p>Any Ideas?</p>
| javascript jquery | [3, 5] |
1,368,169 | 1,368,170 | Mind boggling javascript failure at handling some basic addition! | <p>This is killing me! I'm trying to add the values of four fields together, and I get allllll kinds of wierd results!</p>
<p><strong>The code I have so far:</strong></p>
<pre><code>$('input.percent').change(function() {
var totalup = 1;
var totalup = totalup*1;
$('input.percent').each(function(){
var current = $(this).val();
var curvalue = current * 1;
console.log(curvalue);
console.log(totalup);
var totalup = curvalue + totalup;
});
});
</code></pre>
<p>This should be ungodly simply. Start with a value of zero, get the value of each input, add it to that totaling value. The console log always shows UNDECLARED or NaN for totalup, but if I remove the last decleration of totalup (where it adds more to totalup) it suddenly doesn't become undefined or Nan.</p>
<p>Why is this not ungodly simply!!! I must be missing something dumb, or Javascript just STINKS!</p>
<p>Thanks in advance for your help!</p>
| javascript jquery | [3, 5] |
1,076,551 | 1,076,552 | Android: How do I allow access to only part of an objects members using an interface | <p>How do I "pass an interface", i.e. what CommonsWare suggested to the asker in the <a href="http://stackoverflow.com/questions/2719433/getting-reference-to-calling-activity-from-asynctask-not-as-an-inner-class">question below</a>?></p>
<blockquote>
<p>The other is to make DownloadFileTask
public and pass something into the
constructor. In this case, to minimize
coupling, it may be that you don't
want to pass an Activity, <strong>but some
other sort of interface that limits
what the AsyncTask can do.</strong> That way,
you can choose to implement the
interface on an Activity, or as a
separate object, or whatever. –
CommonsWare Apr 27 '10 at 17:44</p>
</blockquote>
<p>How do I allow a thread to access to only some (or just one) of the objects public methods?</p>
<p>Answer> See the answers below. </p>
<p>The real problem was my misunderstanding of what an interface does. If the input type of a method F (or parameterization of a class) is specified as an interface [i.e. F(my_interface i)], and an object X is passed to that method which implements my_interface [F(X)], then only the members of X which implement my_interface will be accessible to the method F even if other members exist. </p>
<p>I thought an interface put a constraint only on the implementing class. I didn't understand that when an interface was used as a type it would also constrict access to the members of the implementing class. In retrospect, given that Java is statically typed this is obvious. See the <a href="http://download.oracle.com/javase/tutorial/java/IandI/summary-interface.html" rel="nofollow">Java tutorial</a> for more info.</p>
| java android | [1, 4] |
6,001,033 | 6,001,034 | how to copy only the columns in a DataTable to another DataTable? | <p>how to copy only the columns in a DataTable to another DataTable?</p>
| c# asp.net | [0, 9] |
3,821,702 | 3,821,703 | C# alternative for PHP function date('Y-m-d) | <p>What's the easiest way to generate a date string like in PHP with C#/.NET?</p>
| c# php | [0, 2] |
460,331 | 460,332 | jQuery pitfalls to avoid | <p>I am starting a project with jQuery.</p>
<p>What pitfalls/errors/misconceptions/abuses/misuses did you have in your jQuery project?</p>
| javascript jquery | [3, 5] |
5,014,804 | 5,014,805 | Calculating Pixel Distance in QT C++ | <p>I am writing an application , to compare 2 images of same dimensions , I need to compare distance For example if two images of the Same then the distance between those two images would be zero. If two images are completely different than the distance between them would be quite large.The project involves taking a sample image and using that as a base and seeing any distortions in color or gradient have occurred in the subsequent images.</p>
| c# c++ | [0, 6] |
3,089,999 | 3,090,000 | Saving and Adding to A List (Android) | <p>Plain and, hopefully simply...</p>
<p>-What I would like to do is make a list of strings. </p>
<p>-I would like to add to this list while in the application. </p>
<p>-Finally, I want to get each String from this list. </p>
<p>This must be saved somehow so that when you close it and open it back up, the list will save...
How should I get around to this? SharedPreferences? An SQL Database? What should I use to accomplish this?</p>
| java android | [1, 4] |
1,980,580 | 1,980,581 | Java - How can I easily parse XML with XML Pull Parser? | <p>I searched a lot about XML Parsers and found out the Pull Parser would be the best for Android Applications. So I searched for some easy examples to understand but I didn't found one. Can somebody help me and say how you can easily parse XML with Pull Parser (from a URL not assets)?</p>
<p>Thank you :)</p>
| java android | [1, 4] |
3,889,677 | 3,889,678 | Segment text using fullstops | <p>I need to segment text using fullstops using PHP/Javascript.The problem is if I use "." to split text then abbreviations , date formatting (12.03.2010 ) or urls as well split-ed , which I need to prevent.There are many such possibilities , I might not be able to imagine.
How to recognize that the "." is used as fullstop and nothing else ?</p>
<p>When I googled I found about SRX <a href="http://www.lisa.org/fileadmin/standards/srx20.html" rel="nofollow">http://www.lisa.org/fileadmin/standards/srx20.html</a> , is any opensource PHP project segment text using these rules ?</p>
<p>I can do with any Linux based command line utility as well unless it is not paid.</p>
<p>This issue deals with cases where segment is breaking with a dot (.) as it is considered as Fullstop.We need to distinguish between a dot(.) and a Fullstop </p>
<p>Cases where . are not fullstops :</p>
<ol>
<li><p>http://www.yahoo.com'>it is a good link. i liked it</p> - only one valid fullstop</li>
<li><p>This is a test case. Lets try it no valid fullstop</p>
<p>http://www.yahoo.com'>Testing is done by amold12@…. - no valid fullstop</p></li>
<li><p>Mr. Abc is in town today - no valid fullstop</p></li>
<li>S. Khan had done it - no valid fullstop</li>
<li>The U.S. is emerging from a recession. - no valid fullstop</li>
</ol>
<p>As for as code is concerned - I am using javascript text.split(".") method </p>
<p>Thanks</p>
| php javascript | [2, 3] |
2,277,973 | 2,277,974 | ajax success response load to divs | <p>I have three forms and using this jquery function</p>
<pre><code>$('form').submit(function() {
$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: $(this).serialize(),
success: function(response) {
$('#setInfo').fadeOut('500').empty().fadeIn('500').append(response);
}
});
return false;
});
</code></pre>
<p>to submit the form datas, but with this function i am stuck at loading the response at one particular div.</p>
<p>The data i send always have <strong>action=email</strong>, <strong>action=settings</strong>, etc depending on the form.</p>
<p>So how i can use it to load the response of settings in another div and email in another div and all other default in current div.</p>
<p>Thank You.</p>
| javascript jquery | [3, 5] |
5,256,542 | 5,256,543 | How to convert string to "iso-8859-1"? | <p>How can i convert an UTF-8 string into an ISO-8859-1 string?</p>
| c# asp.net | [0, 9] |
3,266,073 | 3,266,074 | Obtaining selected item, value or index from drop down list in formview after button press | <p>I have a formview with an insertion template. In this template there is a drop down list with a number of items I want users to be able to select from. Beside the drop down list there is a button which I am using to add the selected item from the drop down list to a gridview which also exists in the insertion template.</p>
<p>My problem is that when I click the button to add the selected item from the drop down list the selected item, index or value from the drop down list are not available. I am using a OnClick event handler to catch the event from the button click but I suspect there is some kind of refresh of the template going on here which I am not understanding as nothing appears to be accessible from the button event handler. I don't believe a postback is occurring as I have disabled the CausesValidation property for my button.</p>
| c# asp.net | [0, 9] |
3,413,267 | 3,413,268 | How can I find the size of a table cell with javascript | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5221831/how-can-i-find-out-the-size-of-a-cell-with-javascript">How can i find out the size of a cell with javascript</a> </p>
</blockquote>
<p>I want to find the width of a table header. when I do this <code>var width = $('myTH').width</code> it returns "12%" but i want to return the width in pixles. How can I do that? I cant change the width of the <code><th></code> to pixles because i want them to be in percentages so they resize with the screen.</p>
<p>i am using jquery-1.5.js when i do something like $('#myTH') i get an error. I dont knwo if this is related but it means i couldnt use methods suggested to me like <code>$('#myTH').width()</code> or <code>$('#myTH').outerWidth()</code> i get an error "object does not support this property or method" i am guessing it's the # sign</p>
<p><strong>EDIT:</strong></p>
<pre><code><th id="telephoneTH" width="25%" >
<span id="telephoneSpan" class="headerShortDetails">Telephone</span><span onclick="showContactPopup();" class="infoSpans"> ${bean.phoneNumber}</span>
</th>
var width2 = $('#telephoneTH').outerWidth();
alert(width2);
</code></pre>
<p>I get an error 'null' is null or not an onject</p>
| javascript jquery | [3, 5] |
4,433,479 | 4,433,480 | 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] |
5,929,877 | 5,929,878 | How to refresh aspx page from sql server | <p>How to refresh aspx page from sql server.I am using asp.net,C-Sharp with SQL Server 2008.What i mean is i have table, say <strong>Table1</strong>.If any DML operation is performed (Update,Insert etc) to <strong>Table1</strong>,then my page,say <strong>Page1.aspx</strong> should autmatically get refreshed.I can't use <strong>timer</strong> for refreshing the page.I need to trigger the refresh from database.</p>
| c# asp.net | [0, 9] |
5,772,162 | 5,772,163 | jquery: eventObject.pageY and scrollbar | <p>I am using eventObject.pageY to get the current mouse position when the event is fired. But I noticed the number is relative to the document but not the viewport. </p>
<p>I want to get the pageY relative to the viewport(when vertical scrollbar appears it has difference to the pageY relative to the document), how to get that?</p>
| javascript jquery | [3, 5] |
1,940,626 | 1,940,627 | Is it possible to get harddisc size using php or java? | <p>I want to detect the harddisc size of my computer and if possible the the partitions informations(partition size, free memory, used etc).Is it possible in php/java?</p>
| java php | [1, 2] |
4,455,310 | 4,455,311 | Suggest a good Android development workflow | <p>I'm interested in developing android applications. I've a background of Java/Swing/C++/ajax developer so I think I may find myself at home. As I installed the SDK I noticed that I can't follow my usual java development scheme: building base libraries, then the final app. In fact I'd like to develop libs and test them in a more convenient environment like, Swing. There is no way I can use android libs in pure swing apps...
Do you have any suggestion about these topics and what's your development process?</p>
| java android | [1, 4] |
2,910,327 | 2,910,328 | Find Control Text (ASP.NET/C#) | <p>Trying to pull the text value of the label that is dynamically populated by a SQL database. Any help would be greatly appreciated!</p>
<p><em><strong>ASP.NET</em></strong></p>
<pre><code><asp:Label ID="PlatformName" Text='<%# DataBinder.Eval(Container.DataItem, "PlatformName") %>' runat="server" />
</code></pre>
<p><em><strong>C# Code Behind (Which gives me the object, not the string value in the label)</em></strong></p>
<pre><code>string strPlatform = GameGrid.Rows[counter].FindControl("PlatformName").ToString()
</code></pre>
| c# asp.net | [0, 9] |
535,915 | 535,916 | event handler for input delete/undo | <p>I need to check for all events which will change the contents of my text input. so far I have handlers for keyup, cut and paste. but the content can also be changed by highlighting the text and clicking delete or undo. is there a way to listen for these events?</p>
<pre><code>$('#input').on('paste cut keyup ',function() {
//add delete and undo to listner
});
</code></pre>
| javascript jquery | [3, 5] |
2,035,337 | 2,035,338 | Dropdown list is been reloaded? | <p>I had created a dynamic dropdown list and got some data into it. this is been done in ascx.cs page and </p>
<p>When we select the Dropdown list in asp.net,c#. I have been reloading the page and skipping the values. For example: I have a dropdown that have the values:
dropdown - Id's (-- Select --,1,2,3,4,5,6,7,8,9)</p>
<p>When Id is selected the Index Changed event would be fired and the dropdown value I would be sending into it. Then I want to capture that value in an session.</p>
<p>But when I select an Id then the -- Select -- value is been loaded into the dropdown to appear.</p>
<p>The actual think is when I select the value 3 or 6 or anyother based on the selection the data need to be appeared.</p>
<p>Thanks in advance.</p>
| c# asp.net | [0, 9] |
3,243,106 | 3,243,107 | Find if a string contains a specific query string and return its value | <p>I have pagination links set-up like this:</p>
<p><a href="http://localhost/?page=2" rel="nofollow">http://localhost/?page=2</a><br/>
<a href="http://localhost/?page=3" rel="nofollow">http://localhost/?page=3</a></p>
<p>They are wrapped in Anchor links as the HREF attribute. I want to know how can I check first if the HREF attribute for a given ANCHOR contains the query string "page" case sensitive, and if it exists return its number the value after page=</p>
<p>Please give me a straightforward example on this, much appreciated. :)</p>
| javascript jquery | [3, 5] |
4,509,711 | 4,509,712 | How do i swap out images in jquery | <p>I have my site that the users can swap out three products and there are images for each product so rather then doing an ajax call every time the user clicks the button, I wanted to just have the image urls in the html with display none to grab when needed.. so for example, here is my html</p>
<pre><code> <img src="<?php print $product[$selected_product]['product_image']; ?>" width="auto" height="199" alt="" />
</div>
<p style="display:none;" class="image_<?php print $product["standard"]['product_id']; ?>"><?php echo $product["standard"]['product_image']; ?></p>
<p style="display:none;" class="image_<?php print $product["professional"]['product_id']; ?>"><?php echo $product["professional"]['product_image']; ?></p>
<p style="display:none;" class="image_<?php print $product["premium"]['product_id']; ?>"><?php echo $product["premium"]['product_image']; ?></p>
</code></pre>
<p>As you can see the one that is displaying is the one selected but if the user selects one of the other images i need to change the src of the image tag...here is my jquery</p>
<pre><code>var image = $(this).parents(".item").find(".image_" + this_id).text();
image = $.trim(image);
console.log(image)
$(this).parents(".item").find(".item-image img").attr("src", image);
</code></pre>
<p>but the problem is that the console.log prints out the image url correctly but it sometimes when i click the image doesnt change and i get this error</p>
<pre><code>Image corrupt or truncated: http://posnation.com/shop_possystems/image/data/1B.png
</code></pre>
| php javascript jquery | [2, 3, 5] |
5,010,479 | 5,010,480 | Android UID vs iPhone UID | <p>UID - is unique for every device.
But is it possible to determine to wich device it belongs(iPhone or Android i mean) ?</p>
<p>iPhone devices are quite standartised - they come with almoust same hardware but Android is almoust on every device(including iPhone in some cases :) )</p>
| iphone android | [8, 4] |
657,929 | 657,930 | how to get the max value from an input of having same class name using jquery | <p>In my code I need to get the max value of the hidden input field of class name "numberoffield" using jQuery. Anyone can help me.</p>
<pre><code> $('.addTime1').click(function(){
var $i = 0;
$('<div class="fields"><input type="hidden" value="'+$i+'" id="hidden'+$i+'"
class="numberoffield" /></div>').slideDown('slow').appendTo('.inputs');
$i++;
});
</code></pre>
| javascript jquery | [3, 5] |
5,670,861 | 5,670,862 | How Google Doodles are animated | <p>I always wonder how these doodles are animated. Can someone give a detailed description of how these are animated. I know it's using JS to animate an image. But I would like to know how it interacts with the user clicks and timing, and it is also cross browser compatible which amazes me.</p>
<p><img src="http://i.stack.imgur.com/4UzBR.jpg" alt="enter image description here"></p>
| javascript jquery | [3, 5] |
2,766,155 | 2,766,156 | Textarea : elem.val() vs elem.text() | <p>This is very weird. Apparently, I can use both .val() and .text() to manipulate textarea text. </p>
<p>But after I use .val to change the text, I cannot use .text anymore. The converse is not true.</p>
<p>This is leading to some funky bugs. The reason is because a plugin i am using might be using .val to manipulate the text.</p>
<p>Can anyone explain how this works? Thanks! </p>
| javascript jquery | [3, 5] |
1,266,788 | 1,266,789 | How can I make jQuery work even on objects not yet created? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2238616/binding-dynamically-created-elements-in-jquery">Binding dynamically created elements in jQuery</a> </p>
</blockquote>
<p>Is there a way I can change the following code:</p>
<pre><code>$('#city')
.focus(function () {
$('option[value="99"]', this).remove();
store.setItem($(this).attr('id'), $(this).val());
})
.change(function () {
store.setItem($(this).attr('id'), $(this).val());
$(this).attr("title", $("option:selected", this).attr("title"));
$('#detailData').html("");
});
</code></pre>
<p>So that it works for selects even if they have not yet been created as long as they have the class "update-title". for example:</p>
<pre><code><select class="update-title">
</code></pre>
<p>I saw some implementation using live but someone said it was not good to use. Also is there much of an overhead doing this. Would it be better for me to add the code after I am sure the selects have been created with document.ready() ?</p>
| javascript jquery | [3, 5] |
5,227,824 | 5,227,825 | Calling PHP within Javascript results in literal string of function | <p>I feel like i'm going round in circles here and missing something really daft...</p>
<p>My setup is essentially using CodeIgniter on the server-side, and Bootstrap on the client, but that's a little beside the point...</p>
<p>I'm trying to call a php value within a javascript function. The value is being stored in a protected variable within one of the php controllers, which is accessible by the views being loaded in that controller, as i'm accessing the variable directly in the html (and therefore I assumed i could access it in the javascript as well).</p>
<p>The code is here, it's really straight forward:</p>
<pre><code>$(document).ready(function() {
var UID = "<?php echo $the_user->id; ?>";
console.log(UID);
});
</code></pre>
<p>I'm expecting this do do a console output of, say, "1", but it's actually outputting the actual string of <code>"<?php echo $the_user->id; ?>"</code>. This will also happen if i'm just echoing a simple string, rather than a php variable.</p>
<p>I feel like this might be a config issue, but I really have no idea. If I remove the quotes from the php call, I get a</p>
<pre><code>TypeError: can't wrap XML objects
console.log(<?php echo $the_user->id ?>);
</code></pre>
<p>Any ideas? I feel really dumb at this point :(</p>
| php javascript | [2, 3] |
4,150,234 | 4,150,235 | Can one can survive in the IT industry without knowledge of C and C++? | <p>I am just a graduate from India and I have knowledge of Java, JSP and Servlets, Android application development and some iOS development.</p>
<p>I do not have a background in C or C++ and a little weak background in Data Structures and Algorithms. I want to know whether I can make a successful career in the IT industry without knowledge of C or C++ but having a strong grasp on Java and Python (which is what I am thinking of learning next).</p>
<p>As for the Data Structures and Algorithms part I am planning to study them again with implementation in Java as I am not fluent in C or C++. Can I go good in future if I know Data Structures through Java?</p>
| java c++ | [1, 6] |
1,979,677 | 1,979,678 | QueryString Link | <p>I have the following code which works for a postbackurl on a button. What I need to do is do something similar, but with an:</p>
<pre><code><a href></a>
</code></pre>
<p>in asp.net. How can I do that? Thanks for your help!</p>
<pre><code><a href="negativestorydetail.aspx?tag=<%# Eval("Tag") %>" style="color: #ff0000; text-align: center; margin: 15px; line-height: 30px; text-decoration:none; font-size: <%# GetTagSize(Convert.ToDouble(Eval("weight"))) %>"><%# Eval("Tag") %></a>
</code></pre>
<p>C# CODE:</p>
<pre><code>protected string GenerateLinkDetails(object companyId, object projectName, object projectId) {
return string.Format("~/projectdetails.aspx?guid={0}&name={1}&role={2}&member={3}&company={4}&project={5}&proj_id={6}", id, name, company_role, mem_id, companyId, projectName, projectId);
}
</code></pre>
<p>ASP.NET CODE:</p>
<pre><code><asp:Button ID="LinkButtonDetails" runat="server" Text="DETAILS" PostBackUrl='<%# GenerateLinkDetails(Eval("CompanyID"), Eval("ProjectName"), Eval("ProjectID")) %>' />
</code></pre>
| c# asp.net | [0, 9] |
1,937,922 | 1,937,923 | how to add two data set to a grid view table | <pre><code>ds = server.ExecuteQuery(CommandType.Text, MysqlStatement, param);
ds1 = server.ExecuteQuery(CommandType.Text, getOwnMsgQuery, param);
Grid_Messagetable.DataSource =ds;
Grid_Messagetable.DataSource = ds1;
</code></pre>
<p>I have to do two different query to get data for a grid table, but in this case it is showing only result from ds1 as it is executed after ds. How can I do this. Thanks</p>
| c# asp.net | [0, 9] |
2,826,805 | 2,826,806 | How to stop a thread in android which is started using PostDelayed method | <p>I Have created a thread in my android application to fetch data by making http request to a server.
I have used following code to make thread</p>
<p>I have defined handler as </p>
<pre><code>private Handler mHandler = new Handler();
final Runnable mUpdateTimeTask = new Runnable() {
public void run() {
dilogShow=false;
getappdata();
}
};
</code></pre>
<p>and to start this thread i have used following line of code</p>
<pre><code>mHandler.postDelayed(mUpdateTimeTask, 20000);
</code></pre>
<p>and to stop it i am using following line of code which works some times but not always.</p>
<pre><code>mHandler.removeCallbacks(mUpdateTimeTask);
</code></pre>
<p>the getappdata() function is as follows:</p>
<pre><code>public void getappdata() {
final Handler handler = new Handler() {
@Override
public void handleMessage(Message message) {
// managing UI here
};
};
Thread thread = new Thread() {
@Override
public void run() {
// sending http request here
};
};
thread.start();
</code></pre>
<p>}</p>
<p>please help me</p>
| java android | [1, 4] |
4,921,681 | 4,921,682 | Jquery hide div partially | <p>I would like to adjust the width of the div using jquery on click event, and i can't seem to figure out what the exact syntax is.</p>
<p>below is an example of what i tried so far.</p>
<pre><code>$(function() {
$("#square").on("click", function(){
if($(this).css("width", "50")){
$(this).animate({width:"500"}, 1000);
} else {
$(this).animate({width:"50"}, 1000);
}
});
});
</code></pre>
<p><a href="http://jsfiddle.net/4GGP8/" rel="nofollow">http://jsfiddle.net/4GGP8/</a></p>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
2,423,064 | 2,423,065 | using interface in c# | <p>I created a class that's called UserSessionModel; in it I'm storing some data about the user and in particular I'm storing several json strings that are the results of queries and serializations.</p>
<p>I have several methods and properties in UserSessionModel that overall look like this:</p>
<pre><code>public string SomeUserDataInJson1 { get; set; }
public string SomeUserDataInJson2 { get; set; }
.... 3 more properties like this
public int UserID { get; set; }
private void GetSomeUserDataInJson1
{
ObjectData1 TheObjectData1 = new ObjectData1();
UserQueries TheUserQueries = new UserQueries();
JavascriptSerializer TheSerializer = new JavascriptSerializer();
TheObjectData1 = TheUserQueries.GetData1(TheUserID);
this.SomeUserData1InJson = TheSerializer.Serialize(TheObjectData1);
}
</code></pre>
<p>This code is repeated 5 times, with the only change being the ObjectData, the name of the query and the property SomeUserData that's getting set.</p>
<p>Is there a way to make this "better" with an interface or some other c# tools?</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
4,072,367 | 4,072,368 | How to read php array of string in javascript | <pre><code>var longitudeArray = new Array(<?php $result = count($longitudeArray);
if ($result > 1){
echo implode(',', $longitudeArray);
} else {
echo $longitudeArray[0];
}
?>);
</code></pre>
<p><code>$longitudeArray</code> contain array of number like: <code>$longitudeArray = array(23.54545, 2323.32);</code>
Above script create following javascript array:</p>
<pre><code>var longitudeArray = new Array(12.32444,21.34343,23.5454);
</code></pre>
<p>but if i passes string in <code>$longitudeArray</code> like:</p>
<pre><code>$longitudeArray = array('one', 'two');
</code></pre>
<p>instead of integer value in <code>$longitudeArray</code> then my javascript array is not creating properly or its not working.</p>
| php javascript | [2, 3] |
1,269,939 | 1,269,940 | show/hide jquery script | <p>I have got show|hide script. It work's good but I need to modify html of this script</p>
<p><a href="http://jsfiddle.net/kolxoznik1/nRf5f/" rel="nofollow">http://jsfiddle.net/kolxoznik1/nRf5f/</a></p>
<p>like on my schema</p>
<pre><code><!--Links-->
<div>link1</div>
<div>link2</div>
<!--Hide divs-->
<div>Show1</div>
<div>Show2</div>
</code></pre>
<p>and my goal is that html look like this: </p>
<p>example html what I want to do</p>
<pre><code> <div class="product_menu_categories">link_1</div>
<div class="product_menu_categories">link_2</div>
<div class="copy hide">
<ul>
<li><a href="#" id="prod_1" class="product_menu_link">test1</a></li>
<li><a href="#" id="prod_2" class="product_menu_link">test2</a></li>
</ul>
</div>
<div class="copy hide">
<ul>
<li><a href="#" id="prod_6" class="product_menu_link">test4</a></li>
</ul>
</div>
</code></pre>
| javascript jquery | [3, 5] |
4,522,104 | 4,522,105 | i want to transfer data from pc to android phone for which i am using the following code, i am not able to get working directory | <p>I am getting followin error in the code:</p>
<p>java.io.IOException: Error running exec(). Command: ["/adb", -s, 9774d56d682e549c, push, "C:\Documents, and, Settings\My, Documents\other\music\b.wma, ", \sdcard\music] Working Directory: null Environment: null</p>
<pre><code>public class TransferData extends Activity {
private String device_id ;
private String from = "C:\\Documents and Settings\\My Documents\\other\\music\\b.wma ";
private String to ="\\sdcard\\music";
private static final String ADB_PUSH = "\"" /*+ Utility.getWorkDir()*/ + File.separator + "adb\" -s %s push \"%s\" %s";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
device_id = Secure.getString(getBaseContext().getContentResolver(),Secure.ANDROID_ID);
push(device_id,from,to);
}
/** Pushes a file to a connected device via ADB
* @param deviceId Device serial number
* @param from Path of source file (on PC)
* @param to Path of file destination (on device) */
public static void push(String deviceId, String from, String to) {
try {
String cmd = String.format(ADB_PUSH, deviceId, from, to);
System.out.println("adb push: " + cmd);
Process p = Runtime.getRuntime().exec(cmd);
InputStream is = p.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
System.out.println("adb: " + line);
}
} catch (IOException e) {
System.out.println(e);
}
}
</code></pre>
<p>}</p>
| java android | [1, 4] |
5,430,946 | 5,430,947 | Number of folder inside a directory | <p>How do i know the number of folder inside a directory?</p>
<p>I try using <code>System.IO.Directory</code> but no luck!!</p>
<p>thanks,
Pedro</p>
| c# asp.net | [0, 9] |
3,188,481 | 3,188,482 | ie8 split function issue in javascript | <p>I want to split the string with <code>'</span>'</code>. I used the following code</p>
<pre><code>var select_value = td_value.split('</span>');
</code></pre>
<p>It works in fine in FF, chrome. But IE not support this. So i tried the following. But it is not working.</p>
<pre><code>var select_value = td_value.split(/</span.*?>/gi);
</code></pre>
<p>What is the issue with this? please help. Thanks</p>
| php javascript jquery | [2, 3, 5] |
1,878,125 | 1,878,126 | if(value == null) vs if(null == value) | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/271561/why-does-one-often-see-null-variable-instead-of-variable-null-in-c">Why does one often see “null != variable” instead of “variable != null” in C#?</a> </p>
</blockquote>
<p>This is more a curiosity question, is there any performance difference between the statement.</p>
<pre><code> if(value == null)
</code></pre>
<p>and </p>
<pre><code> if(null == value)
</code></pre>
<p>is it noticeable, I use c#, PHP & javascript quite often and I remember someone saying if(null == value) was faster, but is it really? </p>
<p>I will soon be starting development on an application that will parse huge quantities of data in the region of Terabytes so even if the performance gain is in the millisecond range it could have an impact. Anyone have any ideas?</p>
| c# php javascript | [0, 2, 3] |
979,775 | 979,776 | Moving my db to sd card not working | <p>I'm using the code below to try and move my database file to my sdcard. I have no problems except that I get a redline under <code>sd</code>. Any ideas? </p>
<pre><code>File data = Environment.getDataDirectory();
if (sd.canWrite()) {
String currentDBPath = "\\data\\application.package\\databases\\name";
String backupDBPath = "name";
File currentDB = new File(data, currentDBPath);
File backupDB = new File(sd, backupDBPath);
if (currentDB.exists()) {
FileChannel src;
try {
src = new FileInputStream(currentDB).getChannel();
FileChannel dst = new FileOutputStream(backupDB).getChannel();
try {
dst.transferFrom(src, 0, src.size());
src.close();
dst.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
</code></pre>
<p><img src="http://i.stack.imgur.com/PUvCg.png" alt="enter image description here"></p>
<p><img src="http://i.stack.imgur.com/ijc4m.png" alt="enter image description here"></p>
| java android | [1, 4] |
5,896,350 | 5,896,351 | jQuery event not raised in Gridview TH | <p>I have a gridview that fill it with some data.</p>
<pre><code><asp:GridView ID="GridView1" runat="server" ClientIDMode="Static">
</asp:GridView>
</code></pre>
<p>code:</p>
<pre><code> if (!IsPostBack)
{
using (DataClassesDataContext dc = new DataClassesDataContext())
{
GridView1.DataSource = dc.Regions.ToList();
GridView1.DataBind();
}
}
</code></pre>
<p>I want when I clicked on <code>TH</code> section an alert showed.I wrote this code:</p>
<pre><code> <script type="text/javascript">
$('#GridView1 th').on("click", function () {
alert("nima");
});
</script>
</code></pre>
<p>but it doesc not work.where is my mistake?</p>
<p>thanks</p>
<hr>
<p><strong>Edit 1)</strong>
I Edit main question and add <code>'</code> for selector.I forgot to type that.
the problem is when I write this code it works.I want to know on does not work:</p>
<pre><code>$('body').live('click','#GridView1 th', function () {
alert("hello");
});
</code></pre>
| javascript jquery asp.net | [3, 5, 9] |
5,161,191 | 5,161,192 | getting table row of $this parent siblings table ! | <p>i have a href link under my table and i want to be able to manipulate table rows by clicking on that link but i cant get them ! </p>
<p>here is my html </p>
<pre><code><div>
<div> <a href="#remove" class="removelink" > remove </a> </div>
<table>
<tr> <td></td> </tr>
</table>
</div>
</code></pre>
<p>i want to do something like:</p>
<pre><code>$('.removelink').click(function(){
$(this).parent().siblings('table tr:last').remove();
})
</code></pre>
<p>i can get to the table by</p>
<pre><code>$(this).parent().siblings('table')
</code></pre>
<p>but i cant get rows by something like</p>
<pre><code>$(this).parent().siblings('table tr')
</code></pre>
| javascript jquery | [3, 5] |
3,677,273 | 3,677,274 | Prevent script from running using jConfirm like native confirm | <p>i have a problem with jConfirm, it should work just like the normal javascript confim box but it doesn't, here's an example</p>
<pre><code><input type="submit" value="click" onClick="return jConfirm('are you sure?')">
</code></pre>
<p>If i use the normal confirm it stops the script until a response is given, with jConfirm however, the form is still being submitted, even if no answer is given, any workarounds?</p>
<p>Thanks in Advance </p>
<p>EDIT1: Using Slaks idea i'm trying to tweak the default jAlert plugin, here's what i got.</p>
<pre><code>submit: function(message, title, btnId) {
$.alerts._show(title, message, null, 'confirm', function(result, btnId) {
if (result){
var form = $('#'+btnId).closest('form');
form.trigger('submit');
}
else
return false
});
},
</code></pre>
<p>The problem is that i don't know how to pass the 'btnId' variable to the _show callback function, any thoughts?</p>
| javascript jquery | [3, 5] |
5,033,210 | 5,033,211 | The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>) | <p>I am trying to add a css form code . My website uses a master page . I am getting the error The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). </p>
<p>my code snipet </p>
<pre><code>string CssClass = string.Format("{0}/{1}?$BUILD$", BaseImageUrl, CssFileName);
HtmlLink css = new HtmlLink();
css.Href = CssClass;
css.Attributes["rel"] = "stylesheet";
css.Attributes["type"] = "text/css";
Header.Controls.Add(css);
</code></pre>
<p>Any suggestions?</p>
| c# asp.net | [0, 9] |
5,985,784 | 5,985,785 | How can I capture the height of a DIV's css attribute? For instance 'height' | <p>How can I capture the height of a DIV's css attribute? For instance 'height'. Here is the HTML. I am using the jquery plugin height </p>
<pre><code><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.6.1.min.js'> </script>
<script type='text/javascript' src='http://orlandovisitornetwork.com/wp- includes/js/jquery/jquery.js?ver=1.6.1'></script>
<script type="text/javascript"></script>
</head>
<body>
<div id="main" class='test'>
This is just a test
</div>
<script type="text/javascript">
window.onload=function()
{
var height = $("test").height();
if (height > 0px)
{
alert("DIV Height is" + 'height');
}
};
</script>
</body>
</html>
</code></pre>
<p>And here is the css. Of course this is very simplified version.</p>
<pre><code>.test {
height: 500px;
}
</code></pre>
| javascript jquery | [3, 5] |
3,580,588 | 3,580,589 | Use Calendar DayView Control in ASP.NET | <p>I want use Calendar DayView Control in my web application. Please guide me how can I use this control in my web application. Reply me asap.</p>
| c# asp.net | [0, 9] |
4,651,106 | 4,651,107 | jQuery - Way to view jQuery generated html? | <p>Is there a way to view the jQuery (or Javascript) generated HTML - for example, see the jQuery-modified source of a page that uses a number of <code>prepend()</code>'s <code>html()</code>'s etc.?</p>
| javascript jquery | [3, 5] |
4,881,504 | 4,881,505 | how disallow only (a-zA-Z) in asp.net? | <p>how disallow only (a-zA-Z) in asp.net(C#) in textbox ? </p>
| c# asp.net | [0, 9] |
3,750,006 | 3,750,007 | Get Correct keyCode for keypad(numpad) keys | <p>I get keycodes from <strong>96</strong> to <strong>105</strong> when pressing keys on the keypad <strong>[0..9]</strong>
These keycodes correspond with the characters: <strong>'a b c d e f g h i'</strong> instead of <strong>'0 1 2 3 4 5 6 7 8 9'</strong> when calling String.fromCharCode(event.keyCode). </p>
<p><em><strong>Question:</em></strong>
<br/>
I have 3 input[type='text']
when user press keys on first input</p>
<pre><code> if(this key is numeric)
write it to second input
else if (this key is alpha)
write it to third input
</code></pre>
<p>nut it gives 'a' when i push 1 from numpad.
how solve it?</p>
<p><a href="http://jsfiddle.net/AEMLoviji/tABDr/" rel="nofollow">here is my code</a></p>
<p>EDIT: i have used keyup event for this reason a got previous char :-)</p>
| javascript jquery | [3, 5] |
5,579,748 | 5,579,749 | Change date format in javascript (jquery) | <p>I have two dates:</p>
<pre><code>var first = '21-11-2012';
var second = '03-11-2012';
</code></pre>
<p>What is the best way to format it like this:</p>
<pre><code>var first = '2012-11-21';
var second = '2012-11-03';
</code></pre>
<p>Should I use jQuery or simply JavaScript?</p>
| javascript jquery | [3, 5] |
5,458,911 | 5,458,912 | Problem with Generate Local Resource and My simple custom control | <p>I have created simple controls that are based on dot net controls . For example there is a simple GridView control that is based on dot net GridView control , I just set some setting in my control to use it in my .aspx pages , for example I set the Width of GridView in the constructor method : </p>
<pre><code>// constructor of my custom class
public GridView(): base()
{
this.Width = new Unit(100, UnitType.Percentage);
}
</code></pre>
<p>and also I've added some custom properties :</p>
<pre><code> public int SelectedID
{
get
{
if (ViewState["SelectedID" + this.ID] == null)
ViewState["SelectedID" + this.ID] = "-1";
return Convert.ToInt32(ViewState["SelectedID" + this.ID]);
}
set
{
ViewState["SelectedID" + this.ID] = value;
}
}
</code></pre>
<p>The <strong>*<em>Problem</em>*</strong> : when I use Tools>Generate Local Resource in VS2010</p>
<p>the aspx markup before I use this tool is like this : </p>
<pre><code><RPC:GridView ID="grdData" runat="server" onrowcommand="grdData_RowCommand">
</code></pre>
<p>but this tool adds any public property or any setting to my aspx markup , like this :</p>
<pre><code><RPC:GridView ID="grdData" runat="server" onrowcommand="grdData_RowCommand"
meta:resourcekey="grdDataResource1" SelectedID="-1" Width="100%">
</code></pre>
<p>I don't like VS2010 add my settings (like width) and my custom properties (like SelectedID) to aspx markup , this prevent me having the ability of changing my custom control code and reflect changes in all aspx pages that include this control , for example if</p>
<p>I change the width of my control to 50% , it doesn't reflect to any pages</p>
<p>Please tell me what should I do to fix my problem</p>
<p>Thank you very much for your feedbacks </p>
| c# asp.net | [0, 9] |
141,763 | 141,764 | Implement a jQuery plugin method and explain this keyword | <p>I find <a href="http://docs.jquery.com/Plugins/Authoring#Summary_and_Best_Practices" rel="nofollow">a doc for writing jQuery plugin</a>. I don't quite understand the use of <strong>this</strong> keyword.Can someone implement the <code>init</code> function to make it clear?In <code>init</code> function can i use this keyword?If i use,what would it refer to?A simple example will do.</p>
<pre><code>(function( $ ){
var methods = {
init : function( options ) {
// THIS
},
show : function( ) {
// IS
},
hide : function( ) {
// GOOD
},
update : function( content ) {
// !!!
}
};
$.fn.tooltip = function( method ) {
// Method calling logic
if ( methods[method] ) {
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + method + ' does not exist on jQuery.tooltip' );
}
};
})( jQuery );
// calls the init method
$('div').tooltip();
// calls the init method
$('div').tooltip({
foo : 'bar'
});
// calls the hide method
$('div').tooltip('hide');
// calls the update method
$('div').tooltip('update', 'This is the new tooltip content!');
</code></pre>
| javascript jquery | [3, 5] |
5,184,211 | 5,184,212 | Add text to textarea | <p>I'd like to add text "username" to <code>textarea</code> when some event is occurred, and this code works</p>
<pre><code>$("textarea").append("username")
</code></pre>
<p>Exactly until I add some text to that <code>textarea</code> manually. How to avoid this behavior?
This is what I have on html source.</p>
<pre><code><a href="javascript:void(0)" onclick="javascript:add_to_textarea('User')">User</a>
</code></pre>
| javascript jquery | [3, 5] |
3,496,790 | 3,496,791 | Java android programming and java script | <p>I'm developing an android application which takes its information from a site that use JavaScript.</p>
<p>I want to run one of the java script function through my android app.</p>
<p>in example: this site <a href="http://www.bgu.co.il/tremp.aspx" rel="nofollow">http://www.bgu.co.il/tremp.aspx</a> has "Next page" in the bottom (in hebrew) that javascript function do. i want to get to the next page through my app.</p>
<p>How can i send the site the command "move to next page" or activate button's onClick event?</p>
<p><strong>EDIT</strong>: I'm taking information from this site, using an XML parser (sax parser), I want to get to the next page of this site in order to parse it either. I hope I made myself clear now </p>
| java javascript android | [1, 3, 4] |
2,928,350 | 2,928,351 | How to make .jar library from sources | <p>I have Tapjoy sources sources, which have such sructure: <code>Tapjoy/src/com/tapjoy/*.class</code></p>
<p>It must be compiled with Android API Level 9 and higher.
My project is in version Android API Level 8.</p>
<p>So I need to make from sources of <code>Tapjoy -> tapjoy.jar</code> file and include it to my main project.</p>
<p>How can I make <code>.jar</code> file properly with command line or from eclipse?</p>
| java android | [1, 4] |
4,674,966 | 4,674,967 | Conversion of CharSequence to maths expression | <p>In my App i have two TextViews one contains an expression eg. 3 + 4 =</p>
<p>And the second contains an answer eg. 7</p>
<p>How would i go about turning this into a valid maths expression so the app could calculate it and return the answer as an int?</p>
| java android | [1, 4] |
3,330,073 | 3,330,074 | Jquery event handler not firing | <p>I have a web page that is having some javascript issues. I have tried looking over everything however I have a username field and when you click it (<code>.focus</code>) it should bring up a pop up. I used firebug in firefox to put break points right then the <code>.focus</code> function is called and it it is not fired even though I do focus on the username field. I have also looked over spelling and everything. Cant seem to find the issue. Hope someone can help. One more thing, this issue is happening in all browsers. </p>
<p>page link: <a href="http://aliahealthcareer.com/SignUp" rel="nofollow">http://aliahealthcareer.com/SignUp</a></p>
| javascript jquery | [3, 5] |
4,240,228 | 4,240,229 | MaskedEditExtender date format problem ("yyyy-MM-dd" with cultureName="sv-SE" doesn't work) with calender control | <p>I need to create <code>MaskedEditExtender</code> for Sweden date which uses format "yyyy-MM-dd".</p>
<p>I have the following code below. <code>CalendarExtender</code> doesn't work with current <code>MaskedEditExtender</code>. Also the validation doesn't work properly.</p>
<pre class="lang-xml prettyprint-override"><code><asp:TextBox ID="txtFSFV"
MaxLength="100"
style="width:70px"
runat="server" />
<asp:HyperLink ID="hplGetCalendar"
NavigateUrl="javascript:void(null)"
runat="server">
<img src="~/images/calendar.png" runat="server" />
</asp:HyperLink>
<ajax:CalendarExtender ID="calFSFV"
Format="yyyy-MM-dd"
Animated="false"
PopupButtonID="hplGetCalendar"
TargetControlID="txtFSFV"
runat="server" />
<ajax:MaskedEditExtender
ID="maskedFSFV"
TargetControlID="txtFSFV"
Mask="9999-99-99"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Date"
Century="2000"
CultureName="sv-SE"
UserDateFormat="YearMonthDay"
InputDirection="LeftToRight"
runat="server"/>
<ajax:MaskedEditValidator ID="MaskedEditValidator1"
runat="server"
ControlExtender="maskedFSFV"
ControlToValidate="txtFSFV"
InvalidValueMessage="Date is invalid"
IsValidEmpty="True" />
</code></pre>
<p>Could anybody tell me how can I create a mask ("yyyy-MM-dd") for sv-SE culture?</p>
| c# asp.net | [0, 9] |
3,623,022 | 3,623,023 | block user for sometime after insert a data from his ip | <p>I want to block a user for 5-10 minutes after he add some data to server....
It is just like for security...A user can not insert data more than 1 time for 5 to 10 minutes.
Or if I insert something then the javascript function which calls the inserting code will blocked for 5-10 minutes...</p>
<p>Thank in advance..</p>
| php javascript | [2, 3] |
399,044 | 399,045 | Static array in C# ASP .Net | <p>I am getting a strange problem.</p>
<p>I have a static method which is in common DLL and returns a static array of countries from the database.</p>
<p>And using this common method, I am trying to fill a Drop down of Country.</p>
<p>So code will be as below.</p>
<p>In Common - Helper Class DLL code</p>
<pre><code>public static string[] Countries()
{
string qry = "select * from Countries";
Dataset result=SqlHelper.ExecDS(qry);
countryArray = new string[100];
//Filing country array
return countryArray;
}
</code></pre>
<p>In the current project</p>
<pre><code>countryOptions = new string[100];
countryOptions = Common.Helper.Countries();
</code></pre>
<p>I know Drop Down should be bind with DS only but as his is in common DLL i cannot change this.</p>
<p>But now only problem I am facing is even if delete a row from Countries table it is effect is not coming in Countries array. </p>
<p>Common.Helper.Countries() is still returns that row. I have double checked that the row has been deleted but its effect is not coming. Can someone please help me with this?? </p>
| c# asp.net | [0, 9] |
1,853,309 | 1,853,310 | The process cannot access the file because it is being used by another process while deleting image | <p>I am trying to delete original image after thumbnail create but original image cannot be deleted. It throws the exception </p>
<blockquote>
<p>The process cannot access the file because it is being used by another process.</p>
</blockquote>
<p>Here is my code </p>
<pre><code>public static string deleteImage(string imagename,string rootpath)
{
try
{
string completePath = HttpContext.Current.Server.MapPath(rootpath + "Images/") + imagename;
if (File.Exists(completePath))
{
File.Delete(completePath);
}
}
catch (Exception e)
{
throw e;
}
}
</code></pre>
<p>Any idea, I am using Visual Studio 2008, thanks</p>
| c# asp.net | [0, 9] |
1,531,615 | 1,531,616 | How to display selected values from list box in label | <p>I have a list box with multiple selection option , i wanted to display user the selections he has made . </p>
<p>How to display that users in stylish way .</p>
<p>Can anyone help me on this .</p>
<p>Thanks
Smartdev</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.