How i can check if user has input null/empty string in classic-asp? Right now i am doing this.
If Request.Form("productId") == "" Then
'my code here
End If
But its not working.
I am trying to come up with a validation for a nullable property, like int?
Example
[RangeValidator(0, RangeBoundaryType.Inclusive, 1, RangeBoundaryType.Inclusive)]
int? Age { get; set; }
However if I set Age to null validation fails because it doesn't fall in the range, I know I need an [ValidatorComposition(CompositionType.Or)] as well, but what else should I use?
Can any one please let me know the best way to use IF statement in mysql query to show if the "email" field is NULL then it should show as "no email"...
Postcode Telephone Email
----------------------------------------------------------
BS20 0QN 1275373088 no email
BS20 0QN 1275373088 no email
PO9 4HG 023 92474208 [email protected]
SO43 7DS 07801 715200 [email protected]
----------------------------------------------------------
Our code relies on checking the Context.User.Identity value in the Global.asax Application_AuthenticateRequest(...) method to retrieve some information about the logged in user. This works fine in classic mode but when I flip IIS to use the Integrated Pipeline "Context.User" comes back as null, but only intermittently. Any ideas why?
I have < authentication mode="Windows" and only Windows Auth enabled in the Virtual Directory.
I have questions that may or may not have a question_group
if all the questions do not have a question_group and if I use default if empty like this:
question_group defaultQuestion = new question_group {question_group_id = Guid.Empty};
questions.Select(x => x.question_group).DefaultIfEmpty(defaultQuestion).Distinct();
shouldn't I get an IEnumerable<question_group> containing only the default question_group that I defined? I get null.... what am I missing here?
I'm trying to open names.nsf in code. The piece of code has been working for a while but suddenly, I'm getting null. Any idea why? I don't seem to be getting any errors and I don't know how to work out what's wrong.
I can open the database from the Notes client on the same machine.
I have two fields and I need to generate an attribute, using Microsoft Enterprise Library validation, so that either or has to have a value, but both can not be null at the same time.
I have browsed thru other postings on S/O, but I can't find a solution that works for me.
I have a datareader that might return a null value, and if so, I want to value to equal blank
txtMiddleName.Text = rdrGetUserInfo.GetString(1) ?? "";
The string above does not work.
When I walk thru the code, the code jumps to my error trapping block;
Any ideas?
I am using spring mvc in which i convert the arraylist into json string. I have one object 1) results.
My output from spring looks like this:
{
"data":"[{\"userName\":\"test1\",\"firstName\":\"test\",\"lastName\":\"user\"}, {\"userName\":\"test2\",\"firstName\":\"test1\",\"lastName\":\"user1\"}]",
}
I get output as null when i do '$.parseJSON' with this output. When i tried testing only with data object it works fine
Any help would be great.
One of the customers are facing difficulty while logging into our webiste, whenever the user types the first character in UserName text box on the sign in page, he gets below JavaScript error message.
Unable to get value of property 'keyCode': object is null or undefined
We do check for event.keyCode to validate the userName textbox , so as soon as the user types the first character we send the event.keyCode for validation which is failing.
The browser is internet Explorer 9 and we are not able to reproduce the problem in our workstation which has I9
I'm trying to convert a game I made (WindowsFormApplication) to an ASP Page.
My Problem is that I have a lot "private" variables in my WindowFormApplication and those variables are important for the game. But when after I Declare all my variables (in my Page_Load), they turn null no matter what I do(click a button, refresh the page).
Is there anyway to save my variables between buttons (other than Session, because I'd have to create like 6 more sessions)
I have added three methods with parameters:
public static void doSomething(Object obj) {
System.out.println("Object called");
}
public static void doSomething(char[] obj) {
System.out.println("Array called");
}
public static void doSomething(Integer obj) {
System.out.println("Array called");
}
When I am calling doSomething(null) , then compiler throws error as ambiguous methods. So Is the issue because Integer and char[] methods or Integer and Object methods?
Hey,
I would like to have a radiobuttollist were you can select value null.
Something like this:
<asp:RadioButtonList ID="rblCD" runat="server" SelectedValue='<%# Bind("tblCD") %>'>
<asp:ListItem Value="RW">RW</asp:ListItem>
<asp:ListItem Value="R">R</asp:ListItem>
<asp:ListItem Value="DBNull">None</asp:ListItem>
</asp:RadioButtonList>
Thanks a lot,
Vincent
I had recently a crash report where I could see that in the CountDownTimer's onTick method
the getView() call returns null.
I use the onTick method to display the remaining time in a textView. The textView is inside a Fragment.
Since the CountDownTimer runs in the UI thread I have no idea why this had happened.
What could be the cause for this and what is a possible workaround for this problem?
Thanks!
If I access session variable in ashx handler through it is always null. How can I access the current user here.
public void ProcessRequest (HttpContext context) {
context.Session[UIConstants.SessionItems.ID] = Id;
}
I'm using grails 2.3.5 with mongodb 3.0.1 and no hibernate installed. I've a domain class which uses mongo's ObjectId.
import org.bson.types.ObjectId
class Category {
ObjectId id
String name
}
And has a record in mongo database:
{
"_id": ObjectId("53f6c34c33a429240e2ab471"),
"name": "art",
"version": NumberLong("41")
}
When I do, Category.get(new ObjectId("53f6c34c33a429240e2ab471")) somewhere in grails app, it returns null but when I do Category.get("53f6c34c33a429240e2ab471") it then actually returns the result.
Why, get() method does not process ObjectId type?
Can I pass NULL pointer to the first argument of device_create function?
I'm using device_create() to create character device file in sysfs. This file don't represent any physical device (it is used to provide an access to a set of devices connected to various buses). What class should I use with device_create() to create such a file?
I am using protobuf-net to serialize and deserialize my messages. My message also contain come strings that can be null. However when I deserialize them on the other side, I get empty strings ("").
According to google docs, the default value for string type in empty string.
What could be the resolution for this issue?
i want to make empty textbox checking for android. i tried try catch but it was force to close.
below is my codes
try{
name = (EditText)findViewById(R.id.name);
}catch(NullPointerException ex){
new AlertDialog.Builder(KawalanAppXTVT.this).setTitle("Error" )
.setMessage("That's not a number")
.setPositiveButton("OK", null).show();
can someone help me?
I have the following method in a js file in ASP.Net web project. This method is giving the error
Cannot call method 'split' of null
function loadUser_InfoCallBack(res)
{
var ret=res.value;
var senderGUID = ret.split(';')[0];
var senderText = ret.split(';')[1];
if(senderGUID.Length>0)
{
$('hiddenSender.value')=senderGUID;
$('hiddenText.value')=senderText;
}
}
Can anybody suggest the reasons for this error..
I get a JSON response as
{
"edges": [],
"nodes": []
}
how to check if the objects has null values and handle the case??
JSONObject jobj = new JSONObject(line);
JSONArray jArray = jobj.getJSONArray("edges");
if(jArray.length()!=0)
{
for(int i=0;i<jArray.length();i++){
JSONObject json_data = jArray.getJSONObject(i);
x.add((float) json_data.getInt("x"));
y.add((float) json_data.getInt("y"));
end
This retrurns me : org.json.JSONException: end of input at character 0 of
While going through some legacy code today I discovered that you can declare a C# class without placing it in a namespace (in this scenario I have an ASP.NET WebForms application and some of the web forms are not declared within any namespace).
A GetType() on such a class returns a type where the namespace property is set to null.
I did not know that this was allowed - can anyone suggest why it would be desirable to have a class that is not declared within a namespace?
In java, Does the following line has a possiblity (even 0.01%) to throw a NullPointerException??
if (str1 == null)
Actually I am falling some bug in the code and It says that similar line throws a java.lang.NullPointerException ?!
I get this warning when I start debugging. Does anyone know why it's looking in /dev/null for my history.
I know it's some path which was mis-set somewhere but I do not know which?
Any help