|
Try ! This...
DropDownList ddlResultsFooter = (DropDownList)e.Row.FindControl("ddlResultsFooter");
if(ddlResultsFooter != null)
{
//Bind you drop down here
}
- Happy Coding...
STG, Miami
|
|
|
|
|
Try ! This...
DropDownList ddlResultsFooter = (DropDownList)e.Row.FindControl("ddlResultsFooter");
if(ddlResultsFooter != null)
{
//Bind your drop down here
}
- Happy Coding...http://s.codeproject.com/script/Forums/Images/smiley_smile.gif
STG, Miami
|
|
|
|
|
I have a gridview control, which contains multiple rows. Each row has a link-button and a detailsview control. Using the link-button, i want to show or hide the detailsview control.
Initially all the details view have their css property Display=None set. If the link button in any of the grid-view row is clicked, i want a java-script to make the details -view in that row visible (Display=Block )
So i wrote the following javascript:
<script language="javascript" type="text/javascript">
function ShowReplyBox(PMBox) {
myElement = document.getElementById(PMBox);
if (!myElement)
alert('element not found');
myElement.style.display = "block";
}
function HideReplyBox(PMBox) {
myElement = document.getElementById(PMBox)
if (!myElement)
alert('element not found');
myElement.style.display = "none";
}
</script>
While showing the details-view control, it shows momentarily, and again become invisible automatically ...
What could be the problem ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
The script looks fine. I assume your code is calling the show and then the hide script right away.
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.
|
|
|
|
|
do i need to add the return; statement at the end ... ?
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
Depends where you mean. I'm yet to see what code calls these methods, returning a true or false from these methods may stop the other events from triggering, but I can't say, because you've not posted the code that is relevant. your code has no bugs that I can see, it's just being called in ways you don't expect.
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.
|
|
|
|
|
Replace your code with this ...
function ShowReplyBox(PMBox) {
var myElement = document.getElementById(PMBox);
if (!myElement){
alert('element not found');
return;
}
if(myElement.style.display != "block")
myElement.style.display = "block";
}
function HideReplyBox(PMBox) {
var myElement = document.getElementById(PMBox);
if (!myElement){
alert('element not found');
return;
}
if(myElement.style.display != "none")
myElement.style.display = "none";
}
|
|
|
|
|
Would setting the display to block if it already is, cause it to disappear ?
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.
|
|
|
|
|
No. I dont think so.
if I set display = "" it will act similar to display="block"
I dont know what is wrong with his code... Might be his code calling the display="none" just after setting display="block"
|
|
|
|
|
Yeah, the problem has to be that his code is calling both methods. Funny how people ask for help, then don't answer with the details you need to help them
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.
|
|
|
|
|
Yes. you are right..
|
|
|
|
|
Hi guys,
I'm wondering if it there is a better way of doing this, I have 2 webpages, page1 and page2. I want to ensure that users would go to page1 before going to page2 (a button on page1, redirects it to page2), so that if the user types in the URL of page2, it will redirect to page1 first. I am currently using the Request.UrlReferrer.ToString() to get the the previous webpage and comparing it. If it is from page1 then page2 will open if not it will redirect to page1 (the code is below). I'm just wondering if there is a better way of doing this?
Thanks.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.UrlReferrer.ToString() != "page1")
{
Response.Redirect("page1");
}
}
}
|
|
|
|
|
I would put pages one and two on the same URL, as controls. Then I'd use viewstate to store if the user had viewed page one before allowing page 2 to show, and set something on the URL to show page 2.
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.
|
|
|
|
|
Can that be easily done? I have a lot of controls in page1 and page2.
|
|
|
|
|
Yes, just move all the code from your aspx and aspx.cs to ascx and ascx.cs files. Then put those two controls on the one page.
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: I would put pages one and two on the same URL, as controls
I think wizard control has similar property ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
Yes, but the more you use the ridiculous built in stuff, the less control you have over what's going on.
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.
|
|
|
|
|
u r rite ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
Im working with a social network. To change password I use following code
MembershipUser usr=Membership.GetUser(username);
usr.ChangePassword(usr.GetPassword("no answer"), newpassword);
But following error occur: Current membership provider is not configure to allow users to retrieve and reset their password.
How can I configure?
shahdat
|
|
|
|
|
What have you tried ? Did you google the error message ?
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.
|
|
|
|
|
It a error from .NET compiler.
Im web developer of a social network site. I want to develop how a user reset their password when he forgot it.
I require method to change password.
shahdat
|
|
|
|
|
How about ChangePassword control ... ?
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
You have to have the membership provider configured to allow for reseting of password. This will be in the web.config file under 'membership' you need to make sure your provider is configured with enablePasswordReset="true"
|
|
|
|
|
Hi,
string appdir = "http://localhost/myApp";
string strPath = appdir + "test.doc";
FileInfo f = new FileInfo(strPath);
I m getting uri format not supported error.
why this is happening??
Thanks
sjs4u
|
|
|
|
|
sjs4u wrote: string appdir = "http://localhost/myApp";
string strPath = appdir + "test.doc";
Why ?
Try to use Server.MapPath()
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|