object reference not set to an instance of an object

T

Tim

My code is posted below. I am getting the error shown in the subject
on the last line that does the Replace method. I've verified that the
hidden field exists on the form itself.

I am not sure why this is happening.

Any help would be appreciated.

-Tim

string strCreateView;
protected HtmlInputHidden hdnOrigCreateView;

//create the view for the search
strCreateView = "CREATE VIEW #Test AS ";
strCreateView += "SELECT FileIndex, DocTitle, vpath, filename, size,
write, characterization, rank ";

strCreateView += "FROM SCOPE(' DEEP TRAVERSAL OF ( " + strScope + " )
')";

//store the create view statement in the form
//replace all quotes with its ascii equivalent
hdnOrigCreateView.Value = strCreateView.Replace("\"", """);
 
B

Bill Priess

Is the hidden field set to runat="server"? If not, then that is why you are
getting that. Also, not only does it have to be set to runat server, it also
has to be declared in the code-behind.

HTH,

Bill P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top