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
Similar Messages:
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
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
Apr 14, 2010
Our web application hosted from windows 2003 server, is trying to access a file present in a shared folder of another windows 2003 server. The path for the shared folder is configured in the webconfig file in the below format.
<add key="ReportPath" value="\<Server_Name>Reports"/>
if (!File.Exists(ReportPath))
/ Show the report in a link
This function File.Exists() always returns false and when I try to remove the check, it returned the exception, "Logon failure: unknown username or bad password."
View 2 Replies
Jan 5, 2010
i followed this link [URL] and i get selected value from dropdownlist using jquery
i created 3 partial views .
i need depend's on dropdownvalue redirect to partial page , so how can i implement in jquery with conditions?? or how can i implement in this function Public Function FetchData(ByVal dropdownValue As String) As ActionResult??
View 1 Replies
Jan 26, 2011
I'm creating an LDAP class that contains a function that returns the managers username of the current user.
I know that I can use the "manager" attribute to return CN="name", OU="group", DC="company" etc.I specifically want the managers username, does anyone know if there is an attribute string that I can send to LDAP that specifically gets the managers username only? If not, is there an alternative method to do so?
View 2 Replies
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
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
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
Feb 26, 2010
I have many locations stored with addresses and longitude/latitude information in my database.I need a function or store procedure which returns only locations near by 10kms of given longitude/latitude parameters.It is not neccesary to be a sql query but I am fine with any other solution.
View 6 Replies
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
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
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
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
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
May 12, 2010
Here is a bunch of code from a certain site;
Code:
<script type="text/javascript">
function ShowTime() {
[Code]....
the ShowTime function returns server time or client's time.However, I know that javascript executes in the client side.
View 3 Replies
Dec 14, 2010
I have a datagrid and I set up the paging based on how many rows there are like this
With dgBookings
.AllowPaging = True
.PagerStyle.Mode = PagerMode.NumericPages
.PagerStyle.PageButtonCount = 5
.PageSize = 5
End With
Is there a way to set the horizontal-align in the code too I tried adding this
.PagerStyle.HorizontalAlign = Right
and I get this errorArgument not specified for parameter 'Length' of 'Public Function Right(str As String, Length As Integer) As String'.
View 1 Replies
Mar 2, 2010
I have created a web services (WCF) and i have a webmethod that return a string that string is a HTTPCONTEXT.USER.IDENTITY.USER unfortunately it does not return any value.
View 9 Replies
Oct 19, 2010
I have a bound data field, a detailsview, one of the records I have formatted to currency in the item template. Yet when I go to delete a record, I get a error message "Input string was not in correct format". Take away the formatting and the page runs fine. I tried changing the datatype from int to money, it makes no difference.
View 3 Replies
Feb 8, 2011
I have a string which contains javascript.. How can i access that string as javascript function. Below is my string
[Code]....
How can i call this string as javascript function in .cs page.
View 3 Replies
Aug 20, 2010
i am looking for a function that takes two string parameters
str1 = "hello how are you today mr john"
str2 = "how today"
and in return it shoud highlight the words "how" and "today".
View 2 Replies
Jun 17, 2010
I tried to pass a string value into a JavaScript function like below: <%= "'" + prop.property_description + "'") %>) But it does not seems to be the best option, is there a better way to do the above without concatenate the string values with "'"?
View 2 Replies
Feb 22, 2011
i have made a simple chat class but for displaying the msg i use a textbox but by ajax and page post back the scroll bar moves up and its very unprofessional so i need a way to set my returning function string to be displayed in div with scroll bar
View 3 Replies
Mar 14, 2011
I have never passed along variables to a function before. I have a function here that should return true or false.
My question is, how I do this in a realtime example. How do you pass along the 4 string variables to the function and see if cbValid is true or false ?
[Code]....
View 2 Replies
Nov 11, 2010
I want to write a generic function which return either string or Xdocument
[Code]....
In default.aspx
XDocument doc = api.CreateJob<XDocument>("xyz");
threws the exception "Invalid cast from 'System.String' to 'System.Xml.Linq.XDocument'."
How can i do this
View 6 Replies