Security :: Registry OpenSubKey Returns Null?

Sep 2, 2010

It seemed to be the right place to post to.My problem is that when I try to read registry key, I get null value, even if it exists (regedit shows it exists).Application is windows service with Log On As Local System and registry key im trying to read is in HKEY_LOCAL_MACHINESOFTWAREClassesCLSIDOn my development machine (x64 win7) it works fine. But in live server (x64 windows server 2008 r2) I get NULL.ese operating systems should have similar policies or does Local System on server 2008 have any restrictions i should know about?

View 1 Replies


Similar Messages:

System.Web.Security.FormsAuthentication.Encrypt Returns Null?

Apr 21, 2010

I'm trying to encrypt some userData to create my own custom IPrincipal and IIdentity objects using Forms authentication - I've serialized an object representing my logged in user to Json and created my FormsAuthentication ticket like so:

string user_item = GetJsonOfLoggedinUser();/*get JSON representation of my logged in user*/

System.Web.Security.FormsAuthenticationTicket ticket =
new System.Web.Security.FormsAuthenticationTicket(1,
WAM.Utilities.SessionHelper.LoggedInEmployee.F_NAME + " "
+ WAM.Utilities.SessionHelper.LoggedInEmployee.L_NAME,
DateTime.Now, DateTime.Now.AddMinutes(30), false, user_item);
string encrypted_ticket = System.Web.Security.FormsAuthentication.Encrypt(ticket);
HttpCookie auth_cookie =
new HttpCookie(System.Web.Security.FormsAuthentication.FormsCookieName, encrypted_ticket);
Response.Cookies.Add(auth_cookie);

However, the string encrypted_ticket is always null. Is there a limit on the length of the user_item string?

View 1 Replies

Security :: Membership.getuser() Returns Null In Ff And Chrome But Works Fine In IE

Mar 29, 2010

I have strange problem with the membership provider on my mvc application.

I have a webforms page inside admin folder which calls the following code in the models directory.

public int SaveUploadedFile(HttpPostedFileBase fileBase)

View 2 Replies

Security :: Web Service Can't Find Registry Sub Key?

Feb 15, 2010

I have a .Net web service which is being relocated onto a Windows 7 machine running IIS 7.I have set up an application under the default web site and pointed it to the correct location, however when I try to execute a call to the web service, I get a message as follows:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Registry SubKey softwareardexconnections.net not found.

In the past when I had this error, all that has been required to fix it is to set the permissions on that registry sub key to allow read access to the anonymous IIS user. I have given the Everyone group Full Control of this sub key in an attempt to get it working but I still get the same error.This is my first experience with Windows 7 and IIS 7 and it seems quite a bit has changed, so I'm probably missing something.

View 4 Replies

Web Forms :: System Security Exception - Requested Registry Access Is Not Allowed

Mar 12, 2012

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Requested registry access is not allowed.

What changes & where do i make in webconfig??

View 1 Replies

C# - SelectionList Always Returns NULL - How To Fix It

Jul 20, 2010

I have a very strange issue where SelectionList always returns NULL when i try check its Selected Item/Value. I Googled a bit and I found out that when i click the submit button, the page is being refreshed and the SelectionList is being data bound again so it will revert back to its original behavior.

Then i tried enclosing the binding code in the Page_Load event in a !IsPostBack but still when i try to access the Selected property it is null and an exception is thrown.

My code goes something like this... (the braces are not matched properly)

static SelectionList[] Symptoms;
static string UserID = "";

cmbSymptoms1,cmbSymptoms2,cmbSymptoms3 and cmbSymptoms4 are SelectionLists. I took them in to an array of SelectionList and then set the properties.

I had to make them static or else when i click the button to update, they will not retain their values.

protected void Page_Load(object sender, EventArgs e)
{
if (this.IsPostBack == false)
{
//System.Diagnostics.Debug.WriteLine("Not IsPostBack");
if (Request.QueryString["id"] != null && Request.QueryString.ToString() != "")
{
//System.Diagnostics.Debug.WriteLine("id query string is not null :- " + Request.QueryString["id"]);
myclass = new Class1();...........

View 1 Replies

Mvc Json - Color Always Returns Null

May 22, 2010

I am working on a mvc project, and having problem with json. i have created a demo project with list of colors

public JsonResult GetResult()
{
List<string> strList = new List<string>();
strList.Add("white");
strList.Add("blue");
strList.Add("black");
strList.Add("red");
strList.Add("orange");
strList.Add("green");
return this.Json(strList);
}
i am able to get these on my page, but when i try to delete one color, that is when i send the following using jquery
function deleteItem(item) {
$.ajax({
type: "POST",
url: "/Home/Delete/white",
data: "{}",
contentType: "application/json; charset=utf-8",
success: ajaxCallSucceed,
dataType: "json",
failure: ajaxCallFailed
});
}

the controler action public JsonResult Delete(string Color) {} Color always returns null, even if i have specified "/Home/Delete/white" in the url. i know i am doing something wrong or missing something, but not able to find out what.

View 4 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

AJAX :: Every Method Returns Null?

Feb 19, 2010

had used ajax.method in my project & its working fine, but now Every Ajax.Method returns null now,

View 1 Replies

Web Forms :: Datalist Findcontrol Returns Null?

Mar 1, 2010

I have a datalist with price label

<asp:label runat="server" ID="lblPrice" Font-Bold="true" Font-Size="Medium"> <%# DataBinder.Eval(Container.DataItem, "dProduct_price") %></asp:label>

i have used to find the control in my code but when i debug the value is null

Label price = (Label)e.Item.FindControl("lblPrice");

View 1 Replies

DataTable.Rows.Find Returns Null

Feb 13, 2010

I have a DataTable for which a PrimaryKey constraint has been set to be a combination of an integer column and a datetime column. When I try to 'Find' a row by saying,

dtFunds.Rows.Find(iContainerIndex)

I get a null value. iContainerIndex has been defined as an object array of size 2 with the integer ID and date values in it.

When I set a breakpoint in my code, I see that the very same values are present in the datatable.

If I try to execute, DataTable.Select() method with the integer column filter, I get a result - but returns no result when called with the date column filter.

What am I doing wrong here? The very same DateTime value is present in the datatable.

View 1 Replies

C# - Telerik RadComboBox Find Returns Null?

Nov 1, 2010

why the below javascript code always returns null (mean alert) ?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<div>
<telerik:RadComboBox ID="RadComboBox1" runat="server">
</telerik:RadComboBox>
</div>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
var combo = $find("<%= RadComboBox1.ClientID %>");
alert(combo);
</script>
</telerik:RadCodeBlock>
</form>
</body>
</html>

View 2 Replies

ADO.NET :: Linq To SQL Returns Null For DateTime Fields?

Aug 17, 2010

I have a linq to sql entity class in which I declared some DateTime fileds like this:

[Code]....

And this is how I fetch data form repository:

[Code]....

All non DateTime fields are filled properly but all datetimes are null.[Column(DbType = "smalldatetime")]

View 8 Replies

AJAX $find Always Returns Null In Usercontrol?

Jul 30, 2010

I want to use multiple targets with my ModalPopUp extender. One of my buttons is set as target in the ModalPopup and the other one will use server-side code to show the ModalPopup.

This is my ModalPopup so far:

<msAjax:ModalPopupExtender ID="modalInform" runat="server"
BehaviorID="modalInform"
TargetControlID="btnSearchUsers" [code].....

Then I found this little tutorial on the ASP.NET AJAX site.But when I use $find("modalInform") in the pageLoad Javascript function (as defined in the tutorial at the bottom), I'm always getting a $find("modalInform") is null error.

This code is included in a usercontrol, the usercontrol is used in a ASPX page and this ASPX-page uses a MasterPage.
I've noticed that if I'm using

<%= modalInform.ClientID %>

I'm getting a different value then defined in my HTML-source (propably because of the MasterPage?).

View 1 Replies

.net - FormView.FindControl() Returns Null Until DataBind()?

Jan 31, 2010

Why method FindControl() returns null on FormView until call DataBind(). After that it returns everything correctly? What workaround are there? Call DataBind() before first call of FindControl() ?

View 3 Replies

MVC :: Null Action Id Returns System.NullReferenceException?

Oct 26, 2010

This is what I'm trying to run:

[Code]....

When I browse to www.mysite.com/mycontroller/myaction/myid, everything works ok. But visiting www.mysite.com/mycontroller/myaction produces:Server Error in '/' Application.Object reference not set to an instance of an object.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

View 3 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

MVC ViewEngine ViewLocationCache.GetViewLocation Returns Null?

Jan 24, 2010

I am following Chris Pietschmann's solution for theming in ASP.NET MVC.

One thing I have noticed is that the view name is not being retrieved from the ViewLocationCache on subsequent requests. I am using ASP.NET MVC 2.0 RC

When the following code is executed:

this.ViewLocationCache.InsertViewLocation(controllerContext.HttpContext, cacheKey, virtualPath);

and I hover over this.ViewLocationCache it just returns {System.Web.Mvc.NullViewLocationCache} - suggesting nothing was added?

View 1 Replies

C# - DetailsView FindControl() Returns Null After Some Postbacks?

Jan 7, 2010

I've been working for a long time with GridViews and DetailsViews, but yesterday I've come across a new scenario, which I quite do not understand.

I have a GridView with ImageButton (CommandName="Insert") which will change the mode of the DetailsView to Insert. Afterwards I'll look for a DropDownList inside that DetailsView and add some items dynamically. Works fine, but one first the first time I press that ImageButton. If I click on "Cancel" in the DetailsView and press the ImageButton again, the .FindControl() Method returns null.

I've created this sample: (To make it run in your Visual Studio, just bind a DataSource to the DetailsView, otherwise it will not be rendered)

Markup:

<asp:GridView ID="gvCategory" runat="server" OnRowCommand="gvCategory_RowCommand">
<Columns>
</Columns>
<EmptyDataTemplate>

[Code]....

I have also tried using a ItemTemplate, and not a InsertItemTemplate, but this results in the same. After using the ChangeMode-Method the DetailsView.CurrentMode == InsertMode. The only thing I can think of is, that the markup is already generated for the ItemTemplate and changing the Mode to InsertMode can't affect the rendered markup, or something like this.

View 1 Replies

C# - Ajax AsyncFileUpload.FileBytes Returns Null?

Jan 25, 2010

I have a file upload page with an AsyncFileUpload control. When the user browses to the file the upload control pulls the file into memory. I then have an Upload button which fires the following code to save the file to a database.

I am finding that if files are over about 500KB then the FileBytes property of the control simply returns null. This happens on my server but when running the app locally it runs through fine.

I'm not handling the OnUploadCompleted event as I need to user to complete further information before committing the file to database.

I have this in my web.config: httpRuntime maxRequestLength="10000"/>

private void UploadDocument(int mietID)
{
if (Page.IsValid)
{
if (mietID > 0)

[Code]....

View 2 Replies

ConfigurationManager.AppSettings Returns Null When Web.config Is Placed In Parent Dir

Jan 5, 2011

I am facing an amazing problem in ASP.NET. I have a website with many sub directories. The sub directories have aspx and aspx.cs files but do not contain web.config files. I am using the web.config file of the parent directory for storing config items for the respective code files in sub directories. But when i m trying to read the web.config using ConfigurationManager.AppSettings[] with absolutely the correct keys, there's no value being returned. Most amazing fact is, this same code works fine in dev enviroment but not in staging.

View 1 Replies

C# - ADO.NET Entity Framework Quirk - Statement Always Returns Null

Jan 21, 2010

When I run the code below, it works

int charId = int.Parse(Request.Params["charId"]);
EveFPT ctx = new EveFPT();
var theCharQuery = from a in ctx.tblChars
where a.id == charId
select new
{
Name = a.name,
CorpName = a.tblCorps.name,
AllianceName = a.tblCorps.tblAlliances.name
};
if(theCharQuery.Count() == 1)
{
var theChar = theCharQuery.First();
lblCharName.Text = theChar.Name;
lblCorpName.Text = theChar.CorpName;
lblAllianceName.Text = theChar.AllianceName;
}

However, If I the below

var theCharQuery = from a in ctx.tblChars
where a.id == charId
select a;
if(theCharQuery.Count() == 1)
{
tblChars theChar = theCharQuery.First();
lblCharName.Text = theChar.name;
lblCorpName.Text = theChar.tblCorps.name;
lblAllianceName.Text = theChar.tblCorps.tblAlliances.name;
}

the statement theChar.tblCorps always returns null.

View 2 Replies

Ldap Query Returns Null Result When Deployed?

May 10, 2010

I'm using a very simple Ldap query in my asp.net mvc 2.0 site:

String ldapPath = ConfigReader.LdapPath;
String emailAddress = null;

try
{
[code]....

I'm running it under the default app pool.

View 1 Replies

MVC :: Custom Route Returns 404 When All Optional Parameters Are Null?

Feb 19, 2010

I get a 404 error when I navigate to the following URL using the route below:

http://localhost:53999/properties/

However, all the following are correctly routed to the List action in my controller:

http://localhost:53999/properties/usa/new-york/manhattan/12

http://localhost:53999/properties/usa/new-york/manhattan

http://localhost:53999/properties/usa/new-york

http://localhost:53999/properties/usa [Code]....

In PropertiesController.cs: [Code]....

It looks like it should just go to the default controller/action,

View 5 Replies

AJAX :: How To Find Javascript Method Returns Null

Feb 15, 2011

[Code]....

If I use $get, it does work as the expected functionality for $get. It is only $find that does not work.
Can anyone explain the problem?

View 5 Replies







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