• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

SmartNavigation -- Postback

Hi,

1.SmartNavigation:

I have an webform page abc.aspx in which I link to a css file for setting styles to controls on the page. When I set SmartNavigation property to true in the page directive, during the postback the styles set for the controls using the css are not retained. Instead some default styles(font - size, family) are applied. I want the styles from the css to be applied for my controls.  How can this be sorted out?

2.Postback:

Also I have another doubt regarding the postback. I am using an asp:listbox control with multiple items in it, assume 10, and the height of the listbox control is set in such a fashion that only one item is visible all the times(scroll bar appears). Now the problem is, if I select the 5th item and during the postback the 5th item is selected but its not visible. The 1st item in the listbox is always visible. I want the 5th item to be selected and made visible by default during postback. I mean the listbox must be scrolled to the 5th item after postback. Is there any property for this? or How this problem could be solved?

NEED THE SOLUTION URGENTLY.

Regards,
Nallakumar.S
0
nallakumar_s
Asked:
nallakumar_s
1 Solution
 
Commodus2Commented:
I came up with this for nr 2:
private void ListBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
     ListBox1.SelectedIndex = ListBox1.Items.IndexOf(ListBox1.SelectedItem);
}

It shows the selected item. At least in my setup here.

Don't know nr 1 yet. My css stays... even after any postback
0
 
Bob LearnedCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by Commodus2

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now