JQuery .val() Returns Empty String?

Nov 10, 2010

With script below, request to the server always sends empty string (even if value is not emtpty), where the data line is:

data: "{ 'folderName': '" + $(this).val() + "' }"

The html element under investigation is this:

<asp:TextBox id="searcher" runat="server" ClientIDMode="Static" CssClass="classificationFolder" />

Script is:

<script type="text/javascript">
$(document).ready(function () {
$(".classificationFolder").each(function () {

[Code]....

The reason that I select elements by css class selector ($(".classificationFolder")) is that, this control is a user control and used in the same page more than once. That is why I'm not using $("#searcher").

I tested the code In IE8 and Chrome 8.0.552.28 beta. This issue is arising in both of the browsers.

On the other hand, request is sent to the server, client received response successfuly and response is processed on the client.

View 3 Replies


Similar Messages:

C# - RadioButtonList.Selectedvalue Returns An Empty String

Apr 4, 2011

I define the datasource in my c# code and I have a submit button which takes the value of the radiobuttonlist

asp:RadioButtonList ID="RadioPaidIdList" runat="server" DataValueField ="Label" DataTextField = "Label"

First time i click submit it returns an empty value. And next time i select a radiolist and click submit it returns a proper value.

View 2 Replies

SCOPE_IDENTITY() Returns An Empty String After A Confirmed Insert

Oct 13, 2010

This is completely frustrating and probably embarrassing as well. A while back I posted a similar question and resolved the issue. [URL]...scope_identity The program has been working ever since, until yesterday when as it turns out SCOPE_IDENTITY() started returning an empty string even though a record is being inserted. I am not sure what has changed since the fateful day.

[Code]...

I am hoping that there is something I am just not seeing here. A lot of the information I have seen thus far indicates that there are problems with SCOPE_IDENTITY() but most of those are related to inserting multiple records. As you can see this should be fairly straight forward. The thing that really has got my goat is that it used to work and now it doesn't. If someone could take a look at the above code and comment on any anomalies it would be great. Also I have heard suggestions for switching to ADO.NET and it is beginning to look a lot more attractive every day. But I have a ways to go before making the switch so it is SqlDataSources for now

View 37 Replies

Facebook - Fql.query Method Returns Empty String

Jan 29, 2010

I have developed a web application 3 months ago to show facebook users by searching username. To access facebook, I have downloaded facebook dll and got application key, and secret key from facebook. My web application was working fine and displaying records from facebook. yesterday onwards, my application is not working fine. I could not get response when I search by name. I have tested the fql in the facebook testAPI tool online. That time i can get response. but the same fql i used in my appliation but it could not get response from facebook when I search by name. If i search by uid i can get response from facebook. here is my code.

facebook.Components.FacebookService fb = new FacebookService();
fb.ApplicationKey = "bfeefa69afdfe81975f0d6136ace3009";
fb.Secret = "9b672d682e1d8befd06382953fc2615b";
fb.IsDesktopApplication = false;
//the below fql gives response as xml.
//select name, profile_url from user where uid = '1730923544' -I can get response for this fql.
//the below fql does not give response as xml. But it gives empty string.
//the below fql does gives us response as xml when i try in facebook testAPI.
//select name, profile_url from user where name = 'Suresh Rajan' -I couldn't get response for this fql.
string s = fb.fql.query("select name, pic_square, profile_url from user where name = 'Suresh Rajan'");
if (String.IsNullOrEmpty(str1))
Response.Write("Empty Response");
else
Response.Write(str1 + " ");

how to search by name in facebook fql.

View 1 Replies

Forms Data Controls :: Getting Text As Empty String When Gridview Cell Is Empty?

Feb 19, 2010

I have a gridview with two bound fields. On clicking a button i want to display the values in first row of gridview in two textboxes. But if gridview cell is empty i am getting the text in textbox to which the value of cell is given as -' 'i know my problem will be solved if i use the template fields instead. But i want a solution while maintaining the bound fields ,if any.

View 2 Replies

ADO.NET :: SP From Linq Returns Empty Or Null Value

Feb 15, 2011

I have a class library which has my LINQ doc in it. I added a stored procedure and I get the following in my .dbml.layout :

[Code]....

I include a reference to the dll of the class library to my web project and I get an error about value being returned as int where I am trying to put contents into a datalist or similar.

Code in class that calls this SP :

[Code]....

So I switched code to the following in my dbml.layout document :

[Function(Name="dbo.sp_newsSearch")]public IEnumerable<news_search_result> sp_newsSearch([Parameter(DbType="VarChar(200)")] string searchVal){IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), searchVal);return ((IEnumerable<news_search_result>)(result.ReturnValue));}

And included the following in an external file news_search_result.cs

[Code]....

But now I just get nothing returned. Is this wrong way of calling a SP via LINQ? or have I just put the wrong return type on my LINQ class?

View 2 Replies

DataTable Is Always Returns Empty Values?

Feb 17, 2011

I'm .NET newbie and I have to write function which executes stored procedure and return DataTable.

my SqlConnection is already initialized and while running in debugger I can see DataAdapter returns values, but my DataTable is empty.

public DataTable ExecStoredProcedure(String spName, String uId)
{
DataTable dt = new DataTable();
try
{
conn.Open();
SqlCommand cmd = new SqlCommand(spName, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@UnitIDList", uId);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
}
catch (SqlException ex)
{
throw new Exception(ex.StackTrace + ex.Message);.......

View 1 Replies

Empty String - Check If Textbox Empty?

Sep 5, 2010

I have this code, how will I write the code so I can check if a textbox i empty? This way want work. Now it goes in if cellPhone != null all the time.

[Code]....

View 5 Replies

Web Forms :: Import Data From Excel Returns Empty Cell

Feb 11, 2010

I am trying to import data from excel and Reading Excel sheet from asp.net returns empty cell, when the data type is changing from number to text example

Prog
----
2000
4000
6000
AN00 -- reading as empty
BN00 --reading asempty

this is the conncetion string i use with vb.Net

Dim strConn As String = "Provider=Microsoft.Jet.OleDb.4.0;" _
& "data source= '" & FileName & "';" _
& "Extended Properties=Excel 8.0;"

View 3 Replies

Security :: VB.NET Returns System.String[] Instead Of The Actual Value Of The String

Dec 24, 2010

I have two sub routines that I've created to pull in my Membership user roles and assign the value/name of that role to the value of a cookie.

My first subroutine looks like this

[Code]....

At this point, role ID is a 1-dimentional array which is not acceptable for a cookie's value (it must be a string), but in Debug mode, I can see that the array does contain the correct roleID value. In my 2nd subroutine I change the value from array to string for no other reason than that it gives me an opportunity to see that the value of CookieValue() before it is converted does have the correct roleID.

[Code]....

Even though it still shows that string as having the correct value, it returns the object "System.String[]"

View 1 Replies

Security :: Role Membership Returns The Error : The Parameter 'username' Must Not Be Empty?

Jul 16, 2010

[Code]....

returns the error: The parameter 'username' must not be empty.Parameter name: usernameI want to check if a user is logged. If not logged in redirect to loginerror.aspx.

View 9 Replies

Security :: When The Function Returns Ssl Value, If It's Not Empty, Then The Master Page Redirects To The New Url... But The Browser Is Not Showing It?

Oct 20, 2010

I'm trying to set up the SSL in my web app, but don't know if i'm doing it right, or if even i'm taking the right steps in the right order.I have a function in a class that returns the secure URL (https://mydomain.com/...aspx) if the current url is not secure (http)

[Code]....

(Though in develop environment It's like "https://localhost:port" + rawUrl)

when the function returns ssl value, if it's not empty, then the master page redirects to the new url... but the browser is not showing it...

View 5 Replies

Web Forms :: Returns Object Reference Not Set To An Instance Of The Object Because Of Empty Dataset

Aug 27, 2010

private void FillDetails(string pId, out string Name, out string Address)

[code]....

I have method called Filldetails(),This method uses stored procedure to retrieve information for product name and address based on productid passed from productdetails table.I am working on globalization project.We have this product information for US country but there is no product information for germany country.So dataset is empty for germany.As result I am getting error object reference not set to an instance of the object.

View 3 Replies

Vb.net Function Returns Either String Or Nothing?

May 25, 2010

I'm tring to create a vb.net 3.5 function that can return either a string or nothing.

Public
Shared
Function MakeLookupField(ByVal pasString
As
String)

[Code]....

What can I set the return variable to return either a string or null value

View 7 Replies

Forms Data Controls :: Show Column Headers When Gridview Returns Empty Data Set?

Oct 15, 2010

I have in my code a gridview that I redirect to excel, it works fine when I have data in the data set. waht I want is to show column headers when there is no data right now what i get is empty sheet.

View 7 Replies

Using Oledb To Export Excel File Returns Empty File

Feb 24, 2010

I am using asp.net oledb to export information to excel file. I encounter problems when the information to export becomes too big, in this case the code I have given below, the excel file generated becomes an empty spreadsheet. If I changed the loop to 1123 for insertion of the rows. The generated excel file is fine, 1125 rows, and 4 columns shown. A test program in windows form is also working fine regardless of how many rows.
Code has been simplified, "information ..." in the sql insertion command represents 1803 characters.

ExcelObjConn = "Provider=Microsoft.Ace.OLEDB.12.0;" & _
"Data Source=" & fileName & ";Extended Properties=Excel 12.0 XML"
ExcelConnection = New System.Data.OleDb.OleDbConnection(ExcelObjConn)
ExcelConnection.Open()
Try
SqlCommand = "CREATE TABLE ABC ([row1] text, [row2] text, [row3] text, [row4] text)"
ExcelCommand = New OleDb.OleDbCommand(SqlCommand, ExcelConnection)
ExcelCommand.ExecuteNonQuery()
ExcelCommand.Dispose()
For i As Integer = 0 To 1124
SqlCommand = "Insert into ABC ([row1], [row2], [row3], [row4]) Values ('information...', 'information ...', 'information ...', 'information ...')"
ExcelCommand = New OleDb.OleDbCommand(SqlCommand, ExcelConnection)
ExcelCommand.ExecuteNonQuery()
ExcelCommand.Dispose()
Next
Catch ex As Exception
Finally
If ExcelConnection IsNot Nothing Then
ExcelConnection.Close()
ExcelConnection.Dispose()
End If
End Try

I couldn't find a solution to my problem as well. What I did eventually was to run the process using another separate windows service. The code works perfectly fine running from a windows form or service program, but not asp.net, not sure why.

View 1 Replies

WCF / ASMX :: Web Service Returns Empty Set: Xsi:nil="true"?

Aug 25, 2010

I am new to web service. I am trying to connection to an oracle database with 2 input parameters. The web service works fine in the VS2010 environment but when i publish it on to my local machine IIS or on the test web server I do not get a result set back. I get this:

<?xml version="1.0" encoding="utf-8" ?>
<DataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:nil="true" xmlns="http://test.INT/" />

View 2 Replies

WCF / ASMX :: Webservice Returns Xml As A String?

Nov 22, 2010

i work with visual studio 2005 and asp net 2.0 and i must to create a webservice who returns a xml as a string

this string must be use by an application java as i know ..

ok i can create the asmx and my web method who run a sql command BUT how i can return a xml as a string ?

View 3 Replies

C# String Split Returns Double Quotes Out Of No Where?

Dec 16, 2010

Why does this

string test = "Text1, Text2";
string [] tests = test.Split(", ".ToArray());

returns this

[0] = "Text1"
[1] = ""
[2] = "Text2"

what's with the quotes in tests[1] ? I thought the output would be like this

[0] = "Text1"
[1] = "Text2"

View 4 Replies

Web Forms :: Have A Function Which Returns A Value From A Query String Parameter?

Mar 18, 2010

i have a function which returns a value from a query string parameter, i use it in more than 10 places in the webapp thus i have to rewrite the code every time, again and again.so to make it short, is there any way i can embed the code somewhere and keep referring to it through out my app?

View 10 Replies

C# WebClient.DownloadString() Returns String With Perculiar Characters?

Jan 17, 2011

I have an issue with some content that we are downloading from the web for a screen scraping tool that I am building.in the code below, the string returned from the web client download string method returns some odd characters for the source download for a few (not all) web sites.I have recently added http headers as below. Previously the same code was called without the headers to the same effect. I have not tried variations on the 'Accept-Charset' header, I don't know much about text encoding other than the basics.The charachters, or character sequences that I refer to are:

""
and
"Â"

These characters are not seen when you use "view source" in a web browser. What could be causing this and how can I rectify the problem?

string urlData = String.Empty;
WebClient wc = new WebClient();
// Add headers to impersonate a web browser. Some web sites
// will not respond correctly without these headers
wc.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12");
wc.Headers.Add("Accept", "*/*");
wc.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
wc.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
urlData = wc.DownloadString(uri);

View 1 Replies

JQuery :: Ajax Post Returns Null?

Aug 2, 2010

will get to the matter quickly:

I have a new webpage "smile.aspx" with the web method "GetDate" that returns "current date as string".

I am using JQuery to make a Ajax call to that method, Right now i am using ASP.NET Version 2.0[.NET Framework 2.0,Visual Studio 2005].

The parameter returned by the Sucess function seem to return "undefined" .anyone Techhy, quick look at the ajax request code below will answer my problem.

[Code]....

View 2 Replies

C# - The Benefits Of Using String.Empty

Sep 16, 2010

Possible Duplicate: In C#, should I use string.Empty or String.Empty or “” ? just don't understand the benefits of using String.Empty over "". Aside it being strongly typed its longer.

View 2 Replies

JQuery :: Html() Method Returns Null After Postback?

Mar 31, 2011

I have a simple page containing a GridView control that generates thead and tbody tags after rendering. In my jQuery script, I have a line that reads this way:

$('#GridView1
thead').eq(0).html()

When the page loads for the first time, this script returns an objects and works well. But when I click a button and cause a postback, it returns null. By the way, the button changes the number of the rows returned from the data source (based on the value of a textbox) and updates the grid.

View 1 Replies

Web Forms :: Get Rid Of Empty Spaces Before String?

Oct 18, 2010

I have a textbox where email addresses are displayed at the click of a button. There is one problem, before the first email address there are two empty spaces. Is there any way of getting rid of them? The result looks like this: " emailaddress; emailaddress; emailaddress;"

Here's my button click:

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved