|
Hi,
I am new to asp.net.I am using ajaxtabcontainer and ajax tabpanel to generate 4 tabs in the aspx page.But here after the tabs some extra space is generated and that has to be removed.Actualy i have written a code for sitemap.So in between tabs and sitemap space should not be present.I have tried with valign="bottom" but it didnot help.Could you please help me in this regard.
I have pasted my aspx code below.
<pre><table cellpadding="0" cellspacing="0" border="0" >
<!-- Ajax tab container -->
<tr style="background-color: Transparent;" valign="bottom" >
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ajaxToolkit:TabContainer ID="tabcontainer" runat="server" BorderWidth="0" CssClass="ajaxtab">
<td width="50">
</td>
<td>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabAdmin" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnAdmin" runat="server" Height="100%" ImageUrl="/images/Tabs/admin_blue.jpg"
OnClick="ibtnAdmin_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabConfiguration" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnConfiguration" runat="server" Height="100%" ImageUrl="/images/Tabs/configuration_blue.jpg"
OnClick="ibtnConfiguration_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabReports" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnReports" runat="server" Height="100%" ImageUrl="/images/Tabs/report_blue.jpg"
OnClick="ibtnReports_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabSimulation" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnSimulation" runat="server" Height="100%" ImageUrl="/images/Tabs/simulation_Blue.jpg"
OnClick="ibtnSimulation_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td width="50">
</td>
<td>
</td>
<td>
</td>
</ajaxToolkit:TabContainer>
</tr>
</table>
</div>
</td>
</tr>
<tr valign="top">
<td align="center" colspan="2" valign="top">
<div id="divSiteMap">
<table class="SiteMapBars" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="right" valign="middle">
<table border="0" width="100%" cellpadding="6" cellspacing="0">
<tr>
<td align="left" valign="middle">
<asp:SiteMapPath ID="smpLinks" runat="server" Font-Names="Verdana" Font-Bold="true"
Font-Size="X-Small" PathSeparator=" >> ">
<PathSeparatorStyle Font-Bold="True" ForeColor="#990000" Font-Size="Smaller" />
<RootNodeStyle Font-Bold="True" ForeColor="#FF8000" />
<NodeStyle Font-Bold="True" ForeColor="#284E98" />
<RootNodeStyle Font-Bold="True" ForeColor="#FF8000" />
<CurrentNodeStyle ForeColor="#333333" />
</asp:SiteMapPath>
</td>
<td align="right">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr></pre>
|
|
|
|
|
Please use
Firefox => yslow + firebug
IE => pressing f12 and find element (ctrl+ b)
Chrome => right click + inspect element
to find out what exactly is the cause - after that it will be a matter of little CSS modification...
|
|
|
|
|
Thanks a lot for the reply.I found the solution by giving "ImageAlign=AbsBottom" in ImageButton.
|
|
|
|
|
Hi,
I have one more doubt.I got the solution for my previous problem with your help , but now I have one more issue.Inside each ajax tab panel I have written ImageButtons which redirects to corresponding aspx pages.Now here I want to change the imageurl of the ImageButton after once it is clicked to indicate that ajax tab is active by using Ativetabchanged event ofajax tabcontainer.Since I have Response.Redirect in my codebehind it is not going to that event only.I can't use content template here because I need respective home pages for all the modules and hence i must need Imagebuttons for Redirecting.So how to change the Imageurl of that ImageButton ? Please help me in this regard.
Aspx code
------------------------------
<ajaxToolkit:TabContainer ID="tabcontainer" runat="server" BorderWidth="0" CssClass="ajaxtab" OnActiveTabChanged="tabContainer_ActiveTabChanged">
<ajaxToolkit:TabPanel ID="tabAdmin" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnAdmin" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/admin_blue.jpg"
OnClick="ibtnAdmin_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'"/>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabConfiguration" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnConfiguration" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/configuration_blue.jpg"
OnClick="ibtnConfiguration_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'" />
</HeaderTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabReports" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnReports" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/report_blue.jpg"
OnClick="ibtnReports_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'" />
</HeaderTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabSimulation" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnSimulation" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/simulation_Blue.jpg"
OnClick="ibtnSimulation_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'" />
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
aspx.cs
-------------------
protected void tabContainer_ActiveTabChanged(object sender, EventArgs e)
{
if (IsPostBack)
{
switch (tabcontainer.ActiveTab.TabIndex)
{
case 0: ibtnAdmin.ImageUrl = "/images/Tabs/simulation_Gray.jpg";
break;
case 1: ibtnConfiguration.ImageUrl = "/images/Tabs/simulation_Gray.jpg";
break;
case 2: ibtnReports.ImageUrl = "/images/Tabs/simulation_Gray.jpg";
break;
case 3: ibtnSimulation.ImageUrl = "/images/Tabs/simulation_Gray.jpg"; ;
break;
}
}
}
|
|
|
|
|
|
Good Day All
i have 20 Textboxes i am not sure what did i touch by i normally dont play with VS Settings i dont understand. So those textbox are normally defined like this
<asp:TextBox ID="txtUnitLen20" onKeyUp="Jump()" runat="server"
TabIndex="19" AutoPostBack="True"></asp:TextBox>
SerialsText.Add(txtUnitLen1.Text);
but if the value that is entered is "1" , there i will get this as a Value hex like this
[0x00000001] = "1";
Please note that the Textbox gives me "1" but the List gives me those Numbers
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Thanks for moving this.
Can you tell us what SerialsText is. txtUnitLen1.Text will just be the string "1" so the problem probably lies with the SerialsText object.
|
|
|
|
|
Good Day Keith
SerialsText is a List<string> and yes the textbox will give "1" , but when i am adding the value to the List<string> the value changes. I have attached a link to a screenshot that shows the watch of the List
http://www.vbforums.com/attachment.php?attachmentid=81284&stc=1&d=1291022277[^]
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I know it's confusing, but that (0x00000001) is the way that quickwatch displays integers, so in that sense there is nothing wrong. It looks hex but it isn't.
Vuyiswa Maseko wrote:
SerialsText.Add(txtUnitLen1.Text);
but if the value that is entered is "1" , there i will get this as a Value hex like this
[0x00000001] = "1";
Here 0x00000001 is the index of the item in SerialsText not the value itself, so for example if you entered 2 into the same textbox, this will appear as:
[0x00000001] = "2";
Note one thing: the value is "2" (a string) rather than 2 (an integer). You might need validation on your input, and to cast the value to an integer, depending upon your requirements.
Hope this helped!
|
|
|
|
|
Hey,
I am facing a problem.
When i run "exec sp_databases",it returns only system databases.
|
|
|
|
|
First, this should be in the database forum as it has nothing at all to do with ASP.NET.
Second, does the user account you are running this query under have access to the databases you are expecting to see?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Oh!You are right.It should be in database section.
I am running it under administrator rights.
|
|
|
|
|
so... maybe i'm doing something wrong but i'm having no luck checking if the uploaded file length is greater than i want to allow before an exception is thrown and the site crashes
i thought "Request.ContentLength" would allow me to filter out stuff that s too big and give a friendly error message to the user but, as i said, the site crashes with an exception
i have looked but can find no way to handle this exception gracefully ... any ideas gratefully received
also, please don't tell me to make the max upload allowed bigger ... that doesn't really solve the problem
the files are only supposed to be less than 1mb or so
thanks
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
any more detail will help - please try handling on error event @ global.asax...
|
|
|
|
|
You can use the MaxRequestLength[^] in the web.config to limit uploads. It can be discussed how friendly it is to the user.
But one of the problems with the contentlength is that it's not always present.
"When did ignorance become a point of view" - Dilbert
|
|
|
|
|
How are you getting the file? Something like...
Request.Files[0];
If so you can try something like...
if(Request.Files[0] != null && Request.Files[0].InputStream.Length > 1048576)
{
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
thanks to you and the others for the feedback
i discovered the problem is the web server itself having an issue with the uploaded filesize and causing an exception before i even get chance to test and handle it
i had to allow larger uploads and screen for a maxsize before processing but still if a user tries to upload a file bigger than the max i allowed it will cause an exception
not very good design imho
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Your right, that doesn't sound such a good design. thou I guess there needs to be a way to prevent stupid file sizes by default in case people forget to check within program
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
I'm creating a dynamic table and checkboxes at Button_Click event.
The user need to choose some of them and after words press ather button,
my problem is at the post back, how i can show the same dynamic checkboxes with the checked ones.
I tyied to use ViewState, but it's duplicate me the table.
Please help.
10x
|
|
|
|
|
either change your logic to create them at page init or read data at post back and write it back after binding.
|
|
|
|
|
Amar Chaudhary wrote: either change your logic to create them at page init
It works.
10x
|
|
|
|
|
is there key press event on asp.net ? (like in winform) ?
for example when i press enter or Esc on textbox control ?
thank's in advance
|
|
|
|
|
Yes, but you are really thinking of Javascript here. You can attach events to DOM elements, and the textbox supports the onkeypress event.
|
|
|
|
|
yes there is -
To do the same I will recommend you to use JS.
If for some reason you have to do it on server - highly unrecommended - you can turn auto post back on.
If there is something very critical and you need server at all costs then please try using webservices.
|
|
|
|
|
Hi,
In my application I am having a gridview on a page, I want its data to be loaded again only if there is any change at database end in spite of loading same data again and again.
|
|
|
|