Cannot find typenames ("cannot resolve symbol") - asp.net

I have a site in ASP.NET using Telerik AJAX controls.
Despite the latest binary being added to the website project, my code (eg myRadGrid.Datasource = "";) shows a red line on type names as they cannot be found for some reason.
Can anyone possibly explain why or have experience in this sort of problem?
Thanks

Why are you assigning an empty string to the radgrid datasource property? Try setting it to null instead, which is what you do if you want to clear the data source...

Related

Does ASP.NET Membership Provide a Way to Access the aspnet_Profile Table

I would like to be able to retrieve a value of one of the concatenated string properties (PropertyNames column) for the logged in user.
I looked through the Membership class but could not find any way so far.
Any idea? And what would be the best approach?
Got it! Using System.Web.Profile.
Found the following link helpful about extracting individual properties.
Also, the app was throwing the following error:
Could not load type 'System.Web.Security.SqlProfileProvider'
A change was needed to be made in the Web.Config file
The following link pointed to the main issue

Deleting template column

Im using ASP.NET, with c#, with visual studio 2008.
I have a datagrid, and I have a Template column in the datagrid.
I have copied the datagrid from another .aspx. The template column is made for delete purposes(rows of data results),
but I don't need this template column anymore. So I have tried removing it. But when executing I get the error:
"System.ArgumentOutOfRangeException = specified argument was out of range. parameter name index."
The error is thrown when it reaches the line: DataGrid1.DataBind();
How can i fix this ?
Thanks..
I solved it. I had to modify some methods which were called in the InitializeComponent().
Thanks!

Which culture is used by ObjectDataSource to convert string to DateTime

I've just described my problem here: ObjectDataSource fails to parse string to DateTime . After a few google queries I came across this link: ObjectDataSource – Cannot convert value of parameter value from System.String to System.DateTime , and short explanation:
One bug I’ve come across a few times and again just recently is when using an ObjectDataSource with a GridView to update dates. When doing the update the ObjectDataSource always uses the en-US culture and not the culture defined for the application.
The bug has been acknowledged by Microsoft but never fixed.
The workaround that involves manual parsing is ... unacceptable :) Do you know any other, more programmer friendly solution to that issue?
Although this issue was apparently never fixed, there are several workarounds that you may use provided in this link. Not sure why parsing would be unacceptable. It can be done in 1 line of code:
DateTime myDate = DateTime.Parse(myTextBox.Text, CultureInfo.CurrentCulture.DateTimeFormat);
Observe that the culture is not hardcoded (which is the only reason I could think of that would make this unacceptable).

SqlDataSource erroring when retrieving NVARCHAR(max) column

I'm writing a small ASP .Net application in order to retrieve data from a SQL database. The application uses drop downs in order to select what the next drop down should contain and when a page is selected, it should retrieve the HTML from the database. Everything is working until it gets to the retrival of the HTML data. When I try to retrieve the data, I get:
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException:
An unknown error occurred while
processing the request on the server.
The status code returned from the
server was: 500
The HTML column is a defined as NVARCHAR(MAX), but I can't see this causing a problem. The application works if I set the DataValueField to another column. Has one else come across a problem like this? Maybe someone could shine some light on this?
One thing I noted when dealing with varchar(max) columns is that the framework still commonly expects to have a size associated with it. What I ended up having to do was specify the length as -1 to get it to accept a varchar(max) field. Your error message doesn't indicate that this is the problem, but you might try experimenting with it rather than turning off the validation, which could possibly have other repercussions.
Figured it out. Just needed to set ValidateRequest to false at the Page level.

pass data from parent to popup

Apologies if this seems like a duplicate post...
Thomas Warner kindly answeres an earlier post suggesting I use:
Popup.aspx?Data1=Piece_of_data&Data2=Piece_of_data
Just want to ask, if my code is Popup.aspx?Data1=textbox1.text&Data2=textbox2.text
whats the proper way to reference whats in the textboxes?
The way is is above, all that appears in the popup is the actual text 'textbox1.text'
rather than what is actualy in that control.
thanks again
Using asp.net you can litterally write the value straight into the string like:
Popup.aspx?Data1=<%=textbox1.Text%>&Data2=<%=textbox1.Text%>
A more ideal way of doing this would be to build up the URL string in your codebehind so as not to clutter up your HTML and C# code.
That way you could do something like:
String popupUrl = String.Format("Popup.aspx?Data1={0}&Data2={1}",
textbox1.Text,textbox2.Text);
This will also allow you to do any sanitization checks on the values from the textboxes before you start passing those values around.

Resources