16,022,737 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by ThatGuy7 (Top 14 by date)
ThatGuy7
24-Oct-14 22:36pm
View
Ok Tadit, I wasn't gonna post the entire code but I thought it'd be better to put it up. As you can see the panel "pnlPopup" consists of an UpdatePanel and the DetailsView. Ps. the code is still unfinished.
This is the screenshot of what the current output looks like.
http://i.imgur.com/ugIeaW5.png
First, the user fills in the form and after clicking on "Submit" it should bring up the DetailsView in ModalPopupExtender. I want to pass all the data from the form into the TextBoxes in the DetailsView. And my answer is no to your question about checking for the postback. Could you please kindly identify the issue? Thank you so much for your help.
ThatGuy7
24-Oct-14 4:21am
View
Just checked the RowCount and it was 0. Could it be because the DetailsView dvConfirmNewStock is inside a panel and the panel is a ModalPopupExtender therefore it's not present? In which case, how can I get this right?
ThatGuy7
24-Oct-14 4:07am
View
Hi Snesh thanks for your comment!
I got rid of ReadOnly="True" but the situation is still the same unfortunately..
But that is a good lesson I didn't know we can't get value from readonly textbox. I am a newbie just started learning ASP.NET C# last week.
ThatGuy7
24-Oct-14 3:59am
View
Hi Tadit thanks for your advice again!
I tried this and now I'm getting the ArgumentOutOfRangeException.
I have a screenshot of a part of my code. Could you please have a look at it and tell me what is wrong?
http://i.imgur.com/MjOEmSR.png
Thanks
ThatGuy7
23-Oct-14 11:39am
View
OK so how is it not assigning anything into tb2.Text?
ThatGuy7
23-Oct-14 5:08am
View
This is my ItemCommand:
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (DetailsView1.CurrentMode == DetailsViewMode.ReadOnly)
{
if (e.CommandName == "Edit")
{
this.DetailsView1.ChangeMode(DetailsViewMode.Edit);
this.DetailsView1.DataBind();
}
else if (e.CommandName == "Close")
{
this.DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
this.DetailsView1.DataBind();
}
}
else
{
if (e.CommandName == "Close")
{
this.DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
this.DetailsView1.DataBind();
}
}
}
ThatGuy7
23-Oct-14 5:05am
View
Hi Tadit thanks for the comment! I tried that but still the same issue no ModalPopup.. It seems like this issue occurs when I add things in FooterTemplate for some stupid reasons.
The bottom of my gridview is the following
FooterTemplate
<asp:Button ID="btnEdit" runat="server" Text="Edit" OnClick="BtnEdit_OnClick" CommandName="Edit" Height="26px" Width="50px" BackColor="#7AB800" CssClass="viewdetailbutton" />
<asp:Button ID="btnClose" runat="server" Text="Close" CommandName="Close" Height="26px" Width="50px" BackColor="#FF9900" CssClass="viewdetailbutton" />
/FooterTemplate
If I add for example a ButtonField for each button, it shows the modal but that saying I have these buttons in the different rows (which doesnt look very nice and professional).
I've also tried with the ItemCommand. No luck with that either..
ThatGuy7
22-Oct-14 23:57pm
View
Hi Ryan, do I have to place the buttons in a particular field (TemplateField, ButtonField etc.)? I have just placed my buttons in the FooterTemplate, which is inside the DetailsView but just outside the Fields area. Now when I click on View Details button in the GridView, it doesn't fire up the ModalPopupExtender (the View Details button is supposed to bring up the all the details of the product that relates to the row you click in the DetailsView that is fired with the ModalPopup). Could you please give some advice?
ThatGuy7
22-Oct-14 23:50pm
View
Thanks for your advice!
Here I added those two buttons in the DetailsView1 inside the FooterTemplate.
<footertemplate>
<asp:Button ID="btnEdit" runat="server" Text="Edit" OnClick="BtnEdit_OnClick" CommandName="Edit" Height="26px" Width="50px" BackColor="#7AB800" CssClass="viewdetailbutton" />
<asp:Button ID="btnClose" runat="server" Text="Close" CommandName="Close" Height="26px" Width="50px" BackColor="#FF9900" CssClass="viewdetailbutton" />
I encountered another problem possibly caused by the code above.
The problem is that as soon as I added these buttons in the DetailsView1, my ModalPopupExtender no longer shows up. I have checked with a breakpoint inside the
protected void ViewDetails2_Click(object sender, EventArgs e)
{
Button btnDetails = sender as Button;
GridViewRow row = (GridViewRow)btnDetails.NamingContainer;
this.SqlDataSource2.SelectParameters.Clear();
this.SqlDataSource2.SelectParameters.Add("stock_ID", Convert.ToString(this.GridView2.DataKeys[row.RowIndex].Value));
this.DetailsView1.DataSource = this.SqlDataSource2;
this.DetailsView1.DataBind();
this.updPnlStockDetail.Update();
this.mdlPopup.Show();
}
It seems to reach .Show(). It works if I have those buttons outside the DetailsView. What could I do to solve this?
ThatGuy7
22-Oct-14 12:11pm
View
Well my fields area is almost 100 lines of code so as you suggested, I narrowed it down.
ThatGuy7
22-Oct-14 11:57am
View
Ok so it turns out that after clicking on the 'Edit' button, it does not even reach the breakpoint in the ItemCommand first if statement.. I have tried with
BtnEdit_OnClick
{
DetailsView1.ChangeMode(DetailsViewMode.Edit);
}
but the output was the same..
ThatGuy7
22-Oct-14 11:36am
View
Sorry about that. I believe the issue is mainly caused by the DetailsView or the Edit button itself so I narrowed it down to those parts. Could you please have a look at it? Thanks!
ThatGuy7
21-Oct-14 2:57am
View
done that! I wish I could give you millions of stars!!
ThatGuy7
21-Oct-14 2:29am
View
OHHHHHHHHH MY GOD!!!!!!!
YOU ARE ABSOLUTELY A GOD!!!!!!!!
I have been stuck on this bug for the last one week and it is FIXED!!
You have just saved my life!! Thank you so much!!
Show More