Click here to Skip to main content
14,663,832 members
Home » Discussions » ASP.NET
   

ASP.NET

 
GeneralRe: ASP.Net MVC: When to use HttpGet and when to use HttpPost for action Pin
F-ES Sitecore23-Feb-20 22:46
mveF-ES Sitecore23-Feb-20 22:46 
GeneralRe: ASP.Net MVC: When to use HttpGet and when to use HttpPost for action Pin
F-ES Sitecore23-Feb-20 22:52
mveF-ES Sitecore23-Feb-20 22:52 
AnswerRe: ASP.Net MVC: When to use HttpGet and when to use HttpPost for action Pin
Richard Deeming20-Feb-20 0:23
mveRichard Deeming20-Feb-20 0:23 
GeneralRe: ASP.Net MVC: When to use HttpGet and when to use HttpPost for action Pin
Mou_kol21-Feb-20 22:40
MemberMou_kol21-Feb-20 22:40 
GeneralRe: ASP.Net MVC: When to use HttpGet and when to use HttpPost for action Pin
Bohdan Stupak23-Feb-20 0:19
professionalBohdan Stupak23-Feb-20 0:19 
GeneralRe: ASP.Net MVC: When to use HttpGet and when to use HttpPost for action Pin
Richard Deeming23-Feb-20 21:16
mveRichard Deeming23-Feb-20 21:16 
QuestionUpdating two related tables in asp.net core Pin
ElenaRez16-Feb-20 18:35
MemberElenaRez16-Feb-20 18:35 
QuestionBinding combox in gridview with selected value of another comboBox Pin
BikerMonkey14-Feb-20 9:01
professionalBikerMonkey14-Feb-20 9:01 
Hi all, I hope I got the right forum...

I can do what the subject states when the comboBox or DropDown is NOT in a gridview, as in the code below which populates the room DDL with the value that was selected in the building DDL

Protected Sub DDLbuilding_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DDLbuilding.SelectedIndexChanged
        'Create DataTable
        Dim dtRooms As New DataTable() ' - Room Numbers
        dtRooms.Columns.Add("Room", Type.GetType("System.String"))

        'Get Buildings for this campus
        RoomTable = RoomAdapter.GetRooms(DDLbuilding.SelectedValue)

        'Fill DataTable
        For Each RoomRow In RoomTable
            dtRooms.Rows.Add()
            dtRooms.Rows(dtRooms.Rows.Count - 1)("Room") = RoomRow.Room
        Next

        'bind DDLroom to datatable
        DDLroom.DataSource = dtRooms
        DDLroom.DataBind()
    End Sub


but when the comboBox or DDL is in a gridview it throws the error "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control".

Here's what I have so far for the gridview comboBox

Protected Sub cbEQName_SelectedIndexChanged(sender As Object, e As EventArgs)

     'Get row index of selected comboBox
     Dim gvRow As GridViewRow = CType(CType(sender, Control).Parent.Parent, GridViewRow)
     Dim index As Integer = gvRow.RowIndex

     'Get selected value of selected comboBox
     EQname = TryCast(GVnewEquipment.Rows(index).FindControl("cbEQname"), AjaxControlToolkit.ComboBox).Text

     'Get new values of next comboBox from selected value of selected comboBox
     EquipmentTable = EquipmentAdapter.GetMfg(EQname)

     'Create DataTable
     Dim dtMfgs As New DataTable() ' - mfgs that are used by Equiptment name
     dtMfgs.Columns.Add("mfg", Type.GetType("System.String"))

     'Fill DataTable
     For Each EquipmentRow In EquipmentTable
         dtMfgs.Rows.Add()
         dtMfgs.Rows(dtMfgs.Rows.Count - 1)("mfg") = EquipmentRow.mfg
     Next

     'create ComboBox which will represent GVnewQuipment cbMfg comboBox
     Dim CB = DirectCast(GVnewEquipment.Rows(index).FindControl("cbMfg"), AjaxControlToolkit.ComboBox)

     'bind cbMfg to datatable
     CB.DataSource = dtMfgs
     CB.DataBind()

 End Sub


Any and help is greatly appreciated!!
Lee

QuestionHow to get a field's value from a linq query Pin
ElenaRez12-Feb-20 3:09
MemberElenaRez12-Feb-20 3:09 
AnswerRe: How to get a field's value from a linq query Pin
Richard Deeming12-Feb-20 4:45
mveRichard Deeming12-Feb-20 4:45 
QuestionStill having some display problems Pin
samflex7-Feb-20 5:36
Membersamflex7-Feb-20 5:36 
QuestionHow to set starting page or controller method of a web application when we are deploying the React or Angular or Ember applications Pin
simpledeveloper6-Feb-20 14:35
Membersimpledeveloper6-Feb-20 14:35 
AnswerRe: How to set starting page or controller method of a web application when we are deploying the React or Angular or Ember applications Pin
jkirkerx7-Feb-20 10:01
professionaljkirkerx7-Feb-20 10:01 
GeneralRe: How to set starting page or controller method of a web application when we are deploying the React or Angular or Ember applications Pin
simpledeveloper7-Feb-20 12:50
Membersimpledeveloper7-Feb-20 12:50 
QuestionHow do I solve InvalidCaseUserControl.Dispose(bool) no suitable method found to override Pin
Member 114033043-Feb-20 7:36
MemberMember 114033043-Feb-20 7:36 
AnswerRe: How do I solve InvalidCaseUserControl.Dispose(bool) no suitable method found to override Pin
Richard Deeming3-Feb-20 7:46
mveRichard Deeming3-Feb-20 7:46 
GeneralRe: How do I solve InvalidCaseUserControl.Dispose(bool) no suitable method found to override Pin
Member 114033043-Feb-20 8:11
MemberMember 114033043-Feb-20 8:11 
QuestionIn need of direction for project Pin
led3-Feb-20 7:31
Memberled3-Feb-20 7:31 
AnswerRe: In need of direction for project Pin
phil.o3-Feb-20 23:14
mvephil.o3-Feb-20 23:14 
GeneralRe: In need of direction for project Pin
led4-Feb-20 6:21
Memberled4-Feb-20 6:21 
GeneralRe: In need of direction for project Pin
phil.o4-Feb-20 6:38
mvephil.o4-Feb-20 6:38 
Question.net core Swagger code gen Pin
manoj62931-Jan-20 14:28
Membermanoj62931-Jan-20 14:28 
QuestionIIS changing the IE11 document mode from 11 (Default) to 7 (Default) when browsing to a site Pin
holdorf31-Jan-20 5:30
Memberholdorf31-Jan-20 5:30 
AnswerRe: IIS changing the IE11 document mode from 11 (Default) to 7 (Default) when browsing to a site Pin
Richard Deeming31-Jan-20 5:49
mveRichard Deeming31-Jan-20 5:49 
GeneralRe: IIS changing the IE11 document mode from 11 (Default) to 7 (Default) when browsing to a site Pin
holdorf31-Jan-20 6:51
Memberholdorf31-Jan-20 6:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.