7 Replies - 1004 Views - Last Post: 07 November 2016 - 08:34 AM

#1 Jeff_the_creator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 07-September 16

Creating a Panel based on textbox content

Posted 07 November 2016 - 07:25 AM

Hi guys quick question that i am getting stumped on. I currently have a webform page load with query'd information populating a couple textboxes. I want to be able to create a certain panel with buttons over a certain background based on what is contained within one of these textboxes. For example if textbox1 contains "1" create a panel with "~/A.jpg" at certain formatting dimensions, else textbox1 contains "2" create a panel with "~/B.jpg" at different formatting dimensions. I know i cant use if statements in html and am thinking of using JS but cant think of any traction on how to format the JS with if statements building unique panels based on conditions. Any help would be appreciated. Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Creating a Panel based on textbox content

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13389
  • View blog
  • Posts: 53,429
  • Joined: 12-June 08

Re: Creating a Panel based on textbox content

Posted 07 November 2016 - 07:37 AM

That seems super.. odd. Is this panel the same controls for either but with a different background? If so you can do that in the code behind/server side ASP code by using the panel's name and the background property.
Was This Post Helpful? 0
  • +
  • -

#3 Jeff_the_creator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 07-September 16

Re: Creating a Panel based on textbox content

Posted 07 November 2016 - 07:56 AM

Ha, yes very odd. In a long story short no the controls will be different. Im using buttons to create a quadrant/grid like feature that will highlight a transparent button on click with also storing the buttons information. this side of it is pulling that information and displaying the same grid with the clicked buttons so some other user can also view the buttons which were clicked (as a visual aid.) There are multiple panel background pictures with different sizes meaning not all button controls will line up and the grid size will be different. I just figured there was a way to display which panel will pop up on a central page based on a query information box rather than creating separate webforms for each picture. but maybe there isnt. just trying to cut a corner.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13389
  • View blog
  • Posts: 53,429
  • Joined: 12-June 08

Re: Creating a Panel based on textbox content

Posted 07 November 2016 - 07:59 AM

I can't see why you wouldn't have all the panels have the same css style so they would appear in the same area.

hide/show the panels in the code behind/ASP code in reaction to events.
Was This Post Helpful? 0
  • +
  • -

#5 Jeff_the_creator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 07-September 16

Re: Creating a Panel based on textbox content

Posted 07 November 2016 - 08:06 AM

I did think about that. but. If i do that some of the pictures lose a level of detail since the objects on the pictures come in all different shapes and sizes. I.E. one picture might have a control(Button feature) that covers 1/10th of the pictured object while another might cover 1/4 of the object. Since the scaleuler(made up word) size would be the same.
Was This Post Helpful? 0
  • +
  • -

#6 Jeff_the_creator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 07-September 16

Re: Creating a Panel based on textbox content

Posted 07 November 2016 - 08:14 AM

But your answer did get some good ol' brain thinking now. I'll just create css classes for each and call it for a new panel hidden on the page and show visibility if the condition in met wala. thank you for the debating answer. Dont know why I didnt think of something so simple.
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13389
  • View blog
  • Posts: 53,429
  • Joined: 12-June 08

Re: Creating a Panel based on textbox content

Posted 07 November 2016 - 08:19 AM

No problem. Sometimes that server side/client side interaction bit gets sticky.. thankfully ASP.NET makes it fairly easy to implement.
Was This Post Helpful? 0
  • +
  • -

#8 Jeff_the_creator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 07-September 16

Re: Creating a Panel based on textbox content

Posted 07 November 2016 - 08:34 AM

yeah this whole project has been a nightmare to make haha. The bouncing of info that needs to be kept on on client side vs server side hasn't helped add to the mix. Thanks again!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1