Monday, March 26, 2012
tabstop of a textbox
I need to allow users to copy the value of a TextBox but I don't want to
allow them to edit the value. I am able to achieve this by setting the
ReadOnly property to true. But now when the user clicks tabs to navigate
through the controls on the form, I don't want the readonly textbox to get
the focus. In VB6, I used to set the TabStop property to false. How can I
achieve this in ASP.Net?
Thanks.
-NikhilHi,
Set the TabIndex property of the TextBox server control to -1.
"Nikhil Patel" <npatel_wsystems@.hotmail.com> wrote in message
news:#rzFzufiEHA.1652@.TK2MSFTNGP09.phx.gbl...
Hi all,
I need to allow users to copy the value of a TextBox but I don't want to
allow them to edit the value. I am able to achieve this by setting the
ReadOnly property to true. But now when the user clicks tabs to navigate
through the controls on the form, I don't want the readonly textbox to get
the focus. In VB6, I used to set the TabStop property to false. How can I
achieve this in ASP.Net?
Thanks.
-Nikhil
tabstop of a textbox
I need to allow users to copy the value of a TextBox but I don't want to
allow them to edit the value. I am able to achieve this by setting the
ReadOnly property to true. But now when the user clicks tabs to navigate
through the controls on the form, I don't want the readonly textbox to get
the focus. In VB6, I used to set the TabStop property to false. How can I
achieve this in ASP.Net?
Thanks.
-NikhilHi,
Set the TabIndex property of the TextBox server control to -1.
"Nikhil Patel" <npatel_wsystems@.hotmail.com> wrote in message
news:#rzFzufiEHA.1652@.TK2MSFTNGP09.phx.gbl...
Hi all,
I need to allow users to copy the value of a TextBox but I don't want to
allow them to edit the value. I am able to achieve this by setting the
ReadOnly property to true. But now when the user clicks tabs to navigate
through the controls on the form, I don't want the readonly textbox to get
the focus. In VB6, I used to set the TabStop property to false. How can I
achieve this in ASP.Net?
Thanks.
-Nikhil
Saturday, March 24, 2012
tabstrip/multipage
I've been using the tabstrip and multipage controls and really like the way
this combination allows users to switch between tabs without a postback.
I'd like to get more detailed information about these controls but can only
find basic information on the internet. In particular, I'd like to hide or
disable tabs dynamically and I'm not sure how to do this. I'd appreciate any
examples or insight.
Thanks
Mardyhave you tried using the selectedindexchanged .
But you have to set Autopostback ="true" and remember the tabstrip index
starts from "0"
Hope that helps
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:1DABCC32-74F8-49A9-B8DA-B8DFA4CC9539@.microsoft.com...
> Hello
> I've been using the tabstrip and multipage controls and really like the
way
> this combination allows users to switch between tabs without a postback.
> I'd like to get more detailed information about these controls but can
only
> find basic information on the internet. In particular, I'd like to hide or
> disable tabs dynamically and I'm not sure how to do this. I'd appreciate
any
> examples or insight.
> Thanks
> Mardy
For example
If YourTab.SelectedIndex = 0 Then
tsHoriz.Items(0).Enabled = True
tsHoriz.Items(1).Enabled = False
End If
Hope this helps
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:1DABCC32-74F8-49A9-B8DA-B8DFA4CC9539@.microsoft.com...
> Hello
> I've been using the tabstrip and multipage controls and really like the
way
> this combination allows users to switch between tabs without a postback.
> I'd like to get more detailed information about these controls but can
only
> find basic information on the internet. In particular, I'd like to hide or
> disable tabs dynamically and I'm not sure how to do this. I'd appreciate
any
> examples or insight.
> Thanks
> Mardy
Patrick Thanks
I'm using the tabstip as a series of input screens to capture information,
Once the process is complete, I need to hide one of the tabs. So I'd like to
hide an entire tab dynamically from the code behind if the status of the
record is "approved".
I tried using the example you gave but had no success.
"Patrick.O.Ige" wrote:
> For example
> If YourTab.SelectedIndex = 0 Then
> tsHoriz.Items(0).Enabled = True
> tsHoriz.Items(1).Enabled = False
> End If
> Hope this helps
> Patrick
> "Mardy" <Mardy@.discussions.microsoft.com> wrote in message
> news:1DABCC32-74F8-49A9-B8DA-B8DFA4CC9539@.microsoft.com...
> way
> only
> any
>
>
I think I got it
Aspx page:
<iewc:tabstrip id="tsHoriz" runat="server" >
<iewc:Tab Text="Assessment Details" id="tab0"></iewc:Tab>
<iewc:TabSeparator id="ts0"></iewc:TabSeparator>
<iewc:Tab Text="Allocate Requirements" id="tab1"></iewc:Tab>
<iewc:TabSeparator id="ts1"></iewc:TabSeparator>
<iewc:Tab Text="Results" id="tab2"></iewc:Tab>
<iewc:TabSeparator id="ts2"></iewc:TabSeparator>
<iewc:Tab Text=" Design Comments" id="tab3"></iewc:Tab>
<iewc:TabSeparator id="ts3"></iewc:TabSeparator>
<iewc:Tab Text="Attachments" id="tab4"></iewc:Tab>
<iewc:TabSeparator DefaultStyle="width:100%;"></iewc:TabSeparator>
<iewc:multipage id="mpHoriz" ...>
<iewc:PageView id="p0">...
</iewc:PageView>
<iewc:PageView id="p1">...
</iewc:PageView>
...
</iewc:multipage>
code behind:
Protected tab0 As Microsoft.Web.UI.WebControls.Tab
Protected ts0 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab1 As Microsoft.Web.UI.WebControls.Tab
Protected ts1 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab2 As Microsoft.Web.UI.WebControls.Tab
Protected ts2 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab3 As Microsoft.Web.UI.WebControls.Tab
Protected ts3 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab4 As Microsoft.Web.UI.WebControls.Tab
Protected p0 As Microsoft.Web.UI.WebControls.PageView
Protected p1 As Microsoft.Web.UI.WebControls.PageView
Protected p2 As Microsoft.Web.UI.WebControls.PageView
Protected p3 As Microsoft.Web.UI.WebControls.PageView
Protected p4 As Microsoft.Web.UI.WebControls.PageView
'in my sub that checks status of the current record.
tsHoriz.Items.Remove(tab1)
tsHoriz.Items.Remove(ts1)
mpHoriz.Controls.Remove(p1)
Mardy
"Mardy" wrote:
> Hello
> I've been using the tabstrip and multipage controls and really like the wa
y
> this combination allows users to switch between tabs without a postback.
> I'd like to get more detailed information about these controls but can onl
y
> find basic information on the internet. In particular, I'd like to hide or
> disable tabs dynamically and I'm not sure how to do this. I'd appreciate a
ny
> examples or insight.
> Thanks
> Mardy
Try using :- tsHoriz.Items(1).Enabled = False
There were some issues when i worked with the TABSTRIP but can't really
recall now.
Let me know if that doesn;t work and i''ll get back to you.
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:6D81C4DC-03EF-4C9C-8A13-4965D67E901B@.microsoft.com...
> One final note
> This gets me close BUT if I have a postback anywhere in the tabstrip
page,
> I get a nasty viewstate error. This is apparently due to the removal of
the
> mutipage item.
>
>
> "Mardy" wrote:
>
the way
postback.
only
hide or
appreciate any
Tried that without success
"Patrick.O.Ige" wrote:
> Try using :- tsHoriz.Items(1).Enabled = False
> There were some issues when i worked with the TABSTRIP but can't really
> recall now.
> Let me know if that doesn;t work and i''ll get back to you.
> Patrick
>
> "Mardy" <Mardy@.discussions.microsoft.com> wrote in message
> news:6D81C4DC-03EF-4C9C-8A13-4965D67E901B@.microsoft.com...
> page,
> the
> the way
> postback.
> only
> hide or
> appreciate any
>
>
Will get back to you
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:F8258DBF-204D-44D5-88AD-B6C78EEBAA2B@.microsoft.com...
> Tried that without success
> "Patrick.O.Ige" wrote:
>
of
like
can
Mardy..
This should guide you with the Tabstrip:-
http://aspnet101.com/aspnet101/tutorials.aspx?id=28
Hope that helps
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:F8258DBF-204D-44D5-88AD-B6C78EEBAA2B@.microsoft.com...
> Tried that without success
> "Patrick.O.Ige" wrote:
>
of
like
can
tabstrip/multipage
I've been using the tabstrip and multipage controls and really like the way
this combination allows users to switch between tabs without a postback.
I'd like to get more detailed information about these controls but can only
find basic information on the internet. In particular, I'd like to hide or
disable tabs dynamically and I'm not sure how to do this. I'd appreciate any
examples or insight.
Thanks
Mardyhave you tried using the selectedindexchanged .
But you have to set Autopostback ="true" and remember the tabstrip index
starts from "0"
Hope that helps
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:1DABCC32-74F8-49A9-B8DA-B8DFA4CC9539@.microsoft.com...
> Hello
> I've been using the tabstrip and multipage controls and really like the
way
> this combination allows users to switch between tabs without a postback.
> I'd like to get more detailed information about these controls but can
only
> find basic information on the internet. In particular, I'd like to hide or
> disable tabs dynamically and I'm not sure how to do this. I'd appreciate
any
> examples or insight.
> Thanks
> Mardy
For example
If YourTab.SelectedIndex = 0 Then
tsHoriz.Items(0).Enabled = True
tsHoriz.Items(1).Enabled = False
End If
Hope this helps
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:1DABCC32-74F8-49A9-B8DA-B8DFA4CC9539@.microsoft.com...
> Hello
> I've been using the tabstrip and multipage controls and really like the
way
> this combination allows users to switch between tabs without a postback.
> I'd like to get more detailed information about these controls but can
only
> find basic information on the internet. In particular, I'd like to hide or
> disable tabs dynamically and I'm not sure how to do this. I'd appreciate
any
> examples or insight.
> Thanks
> Mardy
Patrick Thanks
I'm using the tabstip as a series of input screens to capture information,
Once the process is complete, I need to hide one of the tabs. So I'd like to
hide an entire tab dynamically from the code behind if the status of the
record is "approved".
I tried using the example you gave but had no success.
"Patrick.O.Ige" wrote:
> For example
> If YourTab.SelectedIndex = 0 Then
> tsHoriz.Items(0).Enabled = True
> tsHoriz.Items(1).Enabled = False
> End If
> Hope this helps
> Patrick
> "Mardy" <Mardy@.discussions.microsoft.com> wrote in message
> news:1DABCC32-74F8-49A9-B8DA-B8DFA4CC9539@.microsoft.com...
> > Hello
> > I've been using the tabstrip and multipage controls and really like the
> way
> > this combination allows users to switch between tabs without a postback.
> > I'd like to get more detailed information about these controls but can
> only
> > find basic information on the internet. In particular, I'd like to hide or
> > disable tabs dynamically and I'm not sure how to do this. I'd appreciate
> any
> > examples or insight.
> > Thanks
> > Mardy
>
I think I got it
Aspx page:
<iewc:tabstrip id="tsHoriz" runat="server" >
<iewc:Tab Text="Assessment Details" id="tab0"></iewc:Tab>
<iewc:TabSeparator id="ts0"></iewc:TabSeparator>
<iewc:Tab Text="Allocate Requirements" id="tab1"></iewc:Tab>
<iewc:TabSeparator id="ts1"></iewc:TabSeparator>
<iewc:Tab Text="Results" id="tab2"></iewc:Tab>
<iewc:TabSeparator id="ts2"></iewc:TabSeparator>
<iewc:Tab Text=" Design Comments" id="tab3"></iewc:Tab>
<iewc:TabSeparator id="ts3"></iewc:TabSeparator>
<iewc:Tab Text="Attachments" id="tab4"></iewc:Tab>
<iewc:TabSeparator DefaultStyle="width:100%;"></iewc:TabSeparator>
<iewc:multipage id="mpHoriz" ...>
<iewc:PageView id="p0">...
</iewc:PageView>
<iewc:PageView id="p1">...
</iewc:PageView>
...
</iewc:multipage
code behind:
Protected tab0 As Microsoft.Web.UI.WebControls.Tab
Protected ts0 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab1 As Microsoft.Web.UI.WebControls.Tab
Protected ts1 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab2 As Microsoft.Web.UI.WebControls.Tab
Protected ts2 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab3 As Microsoft.Web.UI.WebControls.Tab
Protected ts3 As Microsoft.Web.UI.WebControls.TabSeparator
Protected tab4 As Microsoft.Web.UI.WebControls.Tab
Protected p0 As Microsoft.Web.UI.WebControls.PageView
Protected p1 As Microsoft.Web.UI.WebControls.PageView
Protected p2 As Microsoft.Web.UI.WebControls.PageView
Protected p3 As Microsoft.Web.UI.WebControls.PageView
Protected p4 As Microsoft.Web.UI.WebControls.PageView
'in my sub that checks status of the current record.
tsHoriz.Items.Remove(tab1)
tsHoriz.Items.Remove(ts1)
mpHoriz.Controls.Remove(p1)
Mardy
"Mardy" wrote:
> Hello
> I've been using the tabstrip and multipage controls and really like the way
> this combination allows users to switch between tabs without a postback.
> I'd like to get more detailed information about these controls but can only
> find basic information on the internet. In particular, I'd like to hide or
> disable tabs dynamically and I'm not sure how to do this. I'd appreciate any
> examples or insight.
> Thanks
> Mardy
One final note
This gets me close BUT if I have a postback anywhere in the tabstrip page,
I get a nasty viewstate error. This is apparently due to the removal of the
mutipage item.
"Mardy" wrote:
> I think I got it
> Aspx page:
> <iewc:tabstrip id="tsHoriz" runat="server" >
> <iewc:Tab Text="Assessment Details" id="tab0"></iewc:Tab>
> <iewc:TabSeparator id="ts0"></iewc:TabSeparator>
> <iewc:Tab Text="Allocate Requirements" id="tab1"></iewc:Tab>
> <iewc:TabSeparator id="ts1"></iewc:TabSeparator>
> <iewc:Tab Text="Results" id="tab2"></iewc:Tab>
> <iewc:TabSeparator id="ts2"></iewc:TabSeparator>
> <iewc:Tab Text=" Design Comments" id="tab3"></iewc:Tab>
> <iewc:TabSeparator id="ts3"></iewc:TabSeparator>
> <iewc:Tab Text="Attachments" id="tab4"></iewc:Tab>
> <iewc:TabSeparator DefaultStyle="width:100%;"></iewc:TabSeparator>
> <iewc:multipage id="mpHoriz" ...>
> <iewc:PageView id="p0">...
> </iewc:PageView>
> <iewc:PageView id="p1">...
> </iewc:PageView>
> ...
> </iewc:multipage>
> code behind:
> Protected tab0 As Microsoft.Web.UI.WebControls.Tab
> Protected ts0 As Microsoft.Web.UI.WebControls.TabSeparator
> Protected tab1 As Microsoft.Web.UI.WebControls.Tab
> Protected ts1 As Microsoft.Web.UI.WebControls.TabSeparator
> Protected tab2 As Microsoft.Web.UI.WebControls.Tab
> Protected ts2 As Microsoft.Web.UI.WebControls.TabSeparator
> Protected tab3 As Microsoft.Web.UI.WebControls.Tab
> Protected ts3 As Microsoft.Web.UI.WebControls.TabSeparator
> Protected tab4 As Microsoft.Web.UI.WebControls.Tab
> Protected p0 As Microsoft.Web.UI.WebControls.PageView
> Protected p1 As Microsoft.Web.UI.WebControls.PageView
> Protected p2 As Microsoft.Web.UI.WebControls.PageView
> Protected p3 As Microsoft.Web.UI.WebControls.PageView
> Protected p4 As Microsoft.Web.UI.WebControls.PageView
>
> 'in my sub that checks status of the current record.
> tsHoriz.Items.Remove(tab1)
> tsHoriz.Items.Remove(ts1)
> mpHoriz.Controls.Remove(p1)
> Mardy
>
> "Mardy" wrote:
> > Hello
> > I've been using the tabstrip and multipage controls and really like the way
> > this combination allows users to switch between tabs without a postback.
> > I'd like to get more detailed information about these controls but can only
> > find basic information on the internet. In particular, I'd like to hide or
> > disable tabs dynamically and I'm not sure how to do this. I'd appreciate any
> > examples or insight.
> > Thanks
> > Mardy
Try using :- tsHoriz.Items(1).Enabled = False
There were some issues when i worked with the TABSTRIP but can't really
recall now.
Let me know if that doesn;t work and i''ll get back to you.
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:6D81C4DC-03EF-4C9C-8A13-4965D67E901B@.microsoft.com...
> One final note
> This gets me close BUT if I have a postback anywhere in the tabstrip
page,
> I get a nasty viewstate error. This is apparently due to the removal of
the
> mutipage item.
>
>
> "Mardy" wrote:
> > I think I got it
> > Aspx page:
> > <iewc:tabstrip id="tsHoriz" runat="server" >
> > <iewc:Tab Text="Assessment Details" id="tab0"></iewc:Tab>
> > <iewc:TabSeparator id="ts0"></iewc:TabSeparator>
> > <iewc:Tab Text="Allocate Requirements" id="tab1"></iewc:Tab>
> > <iewc:TabSeparator id="ts1"></iewc:TabSeparator>
> > <iewc:Tab Text="Results" id="tab2"></iewc:Tab>
> > <iewc:TabSeparator id="ts2"></iewc:TabSeparator>
> > <iewc:Tab Text=" Design Comments" id="tab3"></iewc:Tab>
> > <iewc:TabSeparator id="ts3"></iewc:TabSeparator>
> > <iewc:Tab Text="Attachments" id="tab4"></iewc:Tab>
> > <iewc:TabSeparator DefaultStyle="width:100%;"></iewc:TabSeparator>
> > <iewc:multipage id="mpHoriz" ...>
> > <iewc:PageView id="p0">...
> > </iewc:PageView>
> > <iewc:PageView id="p1">...
> > </iewc:PageView>
> > ...
> > </iewc:multipage>
> > code behind:
> > Protected tab0 As Microsoft.Web.UI.WebControls.Tab
> > Protected ts0 As Microsoft.Web.UI.WebControls.TabSeparator
> > Protected tab1 As Microsoft.Web.UI.WebControls.Tab
> > Protected ts1 As Microsoft.Web.UI.WebControls.TabSeparator
> > Protected tab2 As Microsoft.Web.UI.WebControls.Tab
> > Protected ts2 As Microsoft.Web.UI.WebControls.TabSeparator
> > Protected tab3 As Microsoft.Web.UI.WebControls.Tab
> > Protected ts3 As Microsoft.Web.UI.WebControls.TabSeparator
> > Protected tab4 As Microsoft.Web.UI.WebControls.Tab
> > Protected p0 As Microsoft.Web.UI.WebControls.PageView
> > Protected p1 As Microsoft.Web.UI.WebControls.PageView
> > Protected p2 As Microsoft.Web.UI.WebControls.PageView
> > Protected p3 As Microsoft.Web.UI.WebControls.PageView
> > Protected p4 As Microsoft.Web.UI.WebControls.PageView
> > 'in my sub that checks status of the current record.
> > tsHoriz.Items.Remove(tab1)
> > tsHoriz.Items.Remove(ts1)
> > mpHoriz.Controls.Remove(p1)
> > Mardy
> > "Mardy" wrote:
> > > Hello
> > > > I've been using the tabstrip and multipage controls and really like
the way
> > > this combination allows users to switch between tabs without a
postback.
> > > > I'd like to get more detailed information about these controls but can
only
> > > find basic information on the internet. In particular, I'd like to
hide or
> > > disable tabs dynamically and I'm not sure how to do this. I'd
appreciate any
> > > examples or insight.
> > > > Thanks
> > > > Mardy
Tried that without success
"Patrick.O.Ige" wrote:
> Try using :- tsHoriz.Items(1).Enabled = False
> There were some issues when i worked with the TABSTRIP but can't really
> recall now.
> Let me know if that doesn;t work and i''ll get back to you.
> Patrick
>
> "Mardy" <Mardy@.discussions.microsoft.com> wrote in message
> news:6D81C4DC-03EF-4C9C-8A13-4965D67E901B@.microsoft.com...
> > One final note
> > This gets me close BUT if I have a postback anywhere in the tabstrip
> page,
> > I get a nasty viewstate error. This is apparently due to the removal of
> the
> > mutipage item.
> > "Mardy" wrote:
> > > I think I got it
> > > > Aspx page:
> > > <iewc:tabstrip id="tsHoriz" runat="server" >
> > > <iewc:Tab Text="Assessment Details" id="tab0"></iewc:Tab>
> > > <iewc:TabSeparator id="ts0"></iewc:TabSeparator>
> > > <iewc:Tab Text="Allocate Requirements" id="tab1"></iewc:Tab>
> > > <iewc:TabSeparator id="ts1"></iewc:TabSeparator>
> > > <iewc:Tab Text="Results" id="tab2"></iewc:Tab>
> > > <iewc:TabSeparator id="ts2"></iewc:TabSeparator>
> > > <iewc:Tab Text=" Design Comments" id="tab3"></iewc:Tab>
> > > <iewc:TabSeparator id="ts3"></iewc:TabSeparator>
> > > <iewc:Tab Text="Attachments" id="tab4"></iewc:Tab>
> > > <iewc:TabSeparator DefaultStyle="width:100%;"></iewc:TabSeparator>
> > > <iewc:multipage id="mpHoriz" ...>
> > > <iewc:PageView id="p0">...
> > > </iewc:PageView>
> > > <iewc:PageView id="p1">...
> > > </iewc:PageView>
> > > ...
> > > </iewc:multipage>
> > > > code behind:
> > > Protected tab0 As Microsoft.Web.UI.WebControls.Tab
> > > Protected ts0 As Microsoft.Web.UI.WebControls.TabSeparator
> > > Protected tab1 As Microsoft.Web.UI.WebControls.Tab
> > > Protected ts1 As Microsoft.Web.UI.WebControls.TabSeparator
> > > Protected tab2 As Microsoft.Web.UI.WebControls.Tab
> > > Protected ts2 As Microsoft.Web.UI.WebControls.TabSeparator
> > > Protected tab3 As Microsoft.Web.UI.WebControls.Tab
> > > Protected ts3 As Microsoft.Web.UI.WebControls.TabSeparator
> > > Protected tab4 As Microsoft.Web.UI.WebControls.Tab
> > > Protected p0 As Microsoft.Web.UI.WebControls.PageView
> > > Protected p1 As Microsoft.Web.UI.WebControls.PageView
> > > Protected p2 As Microsoft.Web.UI.WebControls.PageView
> > > Protected p3 As Microsoft.Web.UI.WebControls.PageView
> > > Protected p4 As Microsoft.Web.UI.WebControls.PageView
> > > > > 'in my sub that checks status of the current record.
> > > tsHoriz.Items.Remove(tab1)
> > > tsHoriz.Items.Remove(ts1)
> > > mpHoriz.Controls.Remove(p1)
> > > > Mardy
> > > > > "Mardy" wrote:
> > > > > Hello
> > > > > > I've been using the tabstrip and multipage controls and really like
> the way
> > > > this combination allows users to switch between tabs without a
> postback.
> > > > > > I'd like to get more detailed information about these controls but can
> only
> > > > find basic information on the internet. In particular, I'd like to
> hide or
> > > > disable tabs dynamically and I'm not sure how to do this. I'd
> appreciate any
> > > > examples or insight.
> > > > > > Thanks
> > > > > > Mardy
>
Will get back to you
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:F8258DBF-204D-44D5-88AD-B6C78EEBAA2B@.microsoft.com...
> Tried that without success
> "Patrick.O.Ige" wrote:
> > Try using :- tsHoriz.Items(1).Enabled = False
> > There were some issues when i worked with the TABSTRIP but can't really
> > recall now.
> > Let me know if that doesn;t work and i''ll get back to you.
> > Patrick
> > "Mardy" <Mardy@.discussions.microsoft.com> wrote in message
> > news:6D81C4DC-03EF-4C9C-8A13-4965D67E901B@.microsoft.com...
> > > One final note
> > > > This gets me close BUT if I have a postback anywhere in the tabstrip
> > page,
> > > I get a nasty viewstate error. This is apparently due to the removal
of
> > the
> > > mutipage item.
> > > > > > > "Mardy" wrote:
> > > > > I think I got it
> > > > > > Aspx page:
> > > > <iewc:tabstrip id="tsHoriz" runat="server" >
> > > > <iewc:Tab Text="Assessment Details" id="tab0"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts0"></iewc:TabSeparator>
> > > > <iewc:Tab Text="Allocate Requirements" id="tab1"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts1"></iewc:TabSeparator>
> > > > <iewc:Tab Text="Results" id="tab2"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts2"></iewc:TabSeparator>
> > > > <iewc:Tab Text=" Design Comments" id="tab3"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts3"></iewc:TabSeparator>
> > > > <iewc:Tab Text="Attachments" id="tab4"></iewc:Tab>
> > > > <iewc:TabSeparator DefaultStyle="width:100%;"></iewc:TabSeparator>
> > > > <iewc:multipage id="mpHoriz" ...>
> > > > <iewc:PageView id="p0">...
> > > > </iewc:PageView>
> > > > <iewc:PageView id="p1">...
> > > > </iewc:PageView>
> > > > ...
> > > > </iewc:multipage>
> > > > > > code behind:
> > > > Protected tab0 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts0 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab1 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts1 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab2 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts2 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab3 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts3 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab4 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected p0 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p1 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p2 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p3 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p4 As Microsoft.Web.UI.WebControls.PageView
> > > > > > > > 'in my sub that checks status of the current record.
> > > > tsHoriz.Items.Remove(tab1)
> > > > tsHoriz.Items.Remove(ts1)
> > > > mpHoriz.Controls.Remove(p1)
> > > > > > Mardy
> > > > > > > > "Mardy" wrote:
> > > > > > > Hello
> > > > > > > > I've been using the tabstrip and multipage controls and really
like
> > the way
> > > > > this combination allows users to switch between tabs without a
> > postback.
> > > > > > > > I'd like to get more detailed information about these controls but
can
> > only
> > > > > find basic information on the internet. In particular, I'd like to
> > hide or
> > > > > disable tabs dynamically and I'm not sure how to do this. I'd
> > appreciate any
> > > > > examples or insight.
> > > > > > > > Thanks
> > > > > > > > Mardy
Mardy..
This should guide you with the Tabstrip:-
http://aspnet101.com/aspnet101/tutorials.aspx?id=28
Hope that helps
Patrick
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:F8258DBF-204D-44D5-88AD-B6C78EEBAA2B@.microsoft.com...
> Tried that without success
> "Patrick.O.Ige" wrote:
> > Try using :- tsHoriz.Items(1).Enabled = False
> > There were some issues when i worked with the TABSTRIP but can't really
> > recall now.
> > Let me know if that doesn;t work and i''ll get back to you.
> > Patrick
> > "Mardy" <Mardy@.discussions.microsoft.com> wrote in message
> > news:6D81C4DC-03EF-4C9C-8A13-4965D67E901B@.microsoft.com...
> > > One final note
> > > > This gets me close BUT if I have a postback anywhere in the tabstrip
> > page,
> > > I get a nasty viewstate error. This is apparently due to the removal
of
> > the
> > > mutipage item.
> > > > > > > "Mardy" wrote:
> > > > > I think I got it
> > > > > > Aspx page:
> > > > <iewc:tabstrip id="tsHoriz" runat="server" >
> > > > <iewc:Tab Text="Assessment Details" id="tab0"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts0"></iewc:TabSeparator>
> > > > <iewc:Tab Text="Allocate Requirements" id="tab1"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts1"></iewc:TabSeparator>
> > > > <iewc:Tab Text="Results" id="tab2"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts2"></iewc:TabSeparator>
> > > > <iewc:Tab Text=" Design Comments" id="tab3"></iewc:Tab>
> > > > <iewc:TabSeparator id="ts3"></iewc:TabSeparator>
> > > > <iewc:Tab Text="Attachments" id="tab4"></iewc:Tab>
> > > > <iewc:TabSeparator DefaultStyle="width:100%;"></iewc:TabSeparator>
> > > > <iewc:multipage id="mpHoriz" ...>
> > > > <iewc:PageView id="p0">...
> > > > </iewc:PageView>
> > > > <iewc:PageView id="p1">...
> > > > </iewc:PageView>
> > > > ...
> > > > </iewc:multipage>
> > > > > > code behind:
> > > > Protected tab0 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts0 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab1 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts1 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab2 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts2 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab3 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected ts3 As Microsoft.Web.UI.WebControls.TabSeparator
> > > > Protected tab4 As Microsoft.Web.UI.WebControls.Tab
> > > > Protected p0 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p1 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p2 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p3 As Microsoft.Web.UI.WebControls.PageView
> > > > Protected p4 As Microsoft.Web.UI.WebControls.PageView
> > > > > > > > 'in my sub that checks status of the current record.
> > > > tsHoriz.Items.Remove(tab1)
> > > > tsHoriz.Items.Remove(ts1)
> > > > mpHoriz.Controls.Remove(p1)
> > > > > > Mardy
> > > > > > > > "Mardy" wrote:
> > > > > > > Hello
> > > > > > > > I've been using the tabstrip and multipage controls and really
like
> > the way
> > > > > this combination allows users to switch between tabs without a
> > postback.
> > > > > > > > I'd like to get more detailed information about these controls but
can
> > only
> > > > > find basic information on the internet. In particular, I'd like to
> > hide or
> > > > > disable tabs dynamically and I'm not sure how to do this. I'd
> > appreciate any
> > > > > examples or insight.
> > > > > > > > Thanks
> > > > > > > > Mardy
Tagging in .NET
Are there any good articles that explain the architecture and tables necessart to implement this?
Thanks in advance.could you explain what you mean by "tagging"?
"implement tagging into my website"
"tagging their RSS feeds."
Whats this "tagging" ?
lol.. jinx Curt... i had my reply window open and stepped away for a bit before i finished my post
Thanks for your reply...
I thought that "tagging" is a fairly well know functionality in the internet world today. I guess I am wrong. Please let me explain...
Flickr.com - allows you to associate words to a photo, or...tag the photo with a descriptive word
http://del.icio.us/ - allows you to "tag" a link with a descriptive word or words.
In my case, I have RSS feeds that I would like to allow the users to "tag" or to associate a descriptive word or words to a feed.
Here is a great article that explains it in more detail. What Im looking to learn and implement is the architecture and datbase tables necessary to incorporate this into my website.
http://freshtakes.typepad.com/znetlady/2005/07/tagging_what_is.html
Thanks again.
So in short:
You are asking "why am I making this more complex than adding a simple 'description' column to a database table" ?
I seriously don't see all the confusing and over-thinking of adding one extra field onto your data table(s) for your users to add/edit/search-on
Thursday, March 22, 2012
taking a file stream and posting it to a web page
I am getting a stream that contains a PDF file and the task is to get that to a browser for the users. I was able to write code to do this with small files, but there are files so big that it can't be stored in the byte array. I wrote a loop to break down the byte array and it comes accross about the right file size, but Adobe Acrobat can't read it and says it's corrupt. I am thinking there must be a way to write the stream directly into the browser. Why do I need to build a byte array to do things like this (all the examples I find use a byte array)? Is there a way to take the stream and just run it directly into the browser?
Here is the code I have. Works as long as the file doesn't exceed the limits of the byte array:
ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load
'This returns the stream fine:
Dim msAs Stream = Test3A()
'Show the file on the web page
Dim bytByteStream()AsByte
ms.Seek(0, SeekOrigin.Begin)
ReDim bytByteStream(CType(ms.Length,Integer) - 1)
ms.Read(bytByteStream, 0,CInt(ms.Length))
Dim countAsInteger = 0
While count < ms.Length
bytByteStream(count) = Convert.ToByte(ms.ReadByte())
'bytByteStream(count) = ms.ReadByte()
count += 1
EndWhile
Dim brAs BinaryReader =New BinaryReader(ms)
Response.AddHeader("Content-Type","application/pdf")
Response.AddHeader("Content-Disposition","inline;filename=def.pdf")
Response.BinaryWrite(bytByteStream)
EndSub
Here is the same code with the do loop to break it down (but returns a file to the browser that Adobe Acrobat can't read: PublicSub test3c(ByVal msAs Stream) 'Show the file on the web page Dim bytByteStream()AsByte Dim intByteIndexAsInteger Response.AddHeader("Content-Type","application/pdf") Response.AddHeader("Content-Disposition","inline;filename=def.pdf") IfCType(ms.Length,Integer) > 65000Then intByteIndex = 65000 Else intByteIndex =CType(ms.Length,Integer) EndIf ms.Seek(0, SeekOrigin.Begin) ReDim bytByteStream(intByteIndex - 1) 'ms.Read(bytByteStream, 0, CInt(ms.Length)) Dim countAsInteger = 0 Dim intPlaceAsInteger = 0 Dim intCyclesAsInteger = 0 While count < ms.Length bytByteStream(intPlace) = Convert.ToByte(ms.ReadByte()) count += 1 intPlace += 1 If intPlace = 65000Then Response.BinaryWrite(bytByteStream)'Writes to the browser intCycles += 1 'Increse the cycle meter IfCType(ms.Length,Integer) - (intCycles * 65000) > 65000Then ReDim bytByteStream(65000)'If we have more than 65K more to go, set up for next chunk Else ReDim bytByteStream(CType(ms.Length,Integer) - (intCycles * 65000))'If less than 65K, then put out whatever we have left EndIf intPlace = 0 'Reset the index placment counter EndIf EndWhile Response.BinaryWrite(bytByteStream)
EndSub
MemoryStream outputStream = ' Construct the stream here...
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.AppendHeader("content-disposition", "inline; filename=PDFFile.PDF")
Response.BinaryWrite(outputStream.ToArray())
outputStream.Close()
Response.End()
NC...
NC,
I see what you are going for and it would be great if it could be simple like what you are doing. However, I am getting a 'stream' from an API which I am passing to the procedure we are working on. Standard 'stream' does not have a "ToArray()" method. Is there a way to convert the stream to a memoryStream? Is there a way around this?
Schu
Try this then:
Dim ms As Stream = Test3A()
Dim outputStream As MemoryStream = CType(ms, MemoryStream)
' Rest of code...
NC...
I get the following error:
Unable to cast object of type 'EMC.Centera.BlobStreams.BlobReadStream' to type 'System.IO.MemoryStream'.
It allowed me to pull it out into a byte array as shown in my earlier code, any other ideas on what would work?
Schu
I have no idea what an 'EMC.Centera.BlobStreams.BlobReadStream' is. I tried the cast with a normal Stream object with no problem, so no, I have no idea.
Did you try:
Dim ms As MemoryStream = Test3A()
NC...
Yes, I know, that is from the API. They claim it is coming out as a simple stream (but obviously if it were we wouldn't have issues). I rewrote the code assumeing it was a memorystream and got the error:
Specified argument was out of the range of valid values.
Parameter name: offset
when I got to the "...(outputStream.ToArray()). Any thoughts?
I was looking through the documentation for this vendor code (sparse) and they mention that the stream is a "blobstream". then it says "that is what your VB code will use to Read - the Stream.Read method."
So, is there a way to convert a blob stream into a memorystream?
Schu
Well, since I have no access to the API that you are using, and all the references to "BlobStream" seem to be Java API related, who can tell? I'd request help from the vendor that created the API as I don't think that you will get much help here.
You know, if you could write the BlobStream thing to a temporary file, this would work:
Dim fileName As String = Server.MapPath("~\Reports\TestPdfFile.pdf")
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(fileName)
Response.Flush()
Response.Close()
NC...
Yea, that's a good idea too. Late last night I got together with a couple of the sr devs here and we came up with the following solution that seems to be working. I rem'd out the code that I had in the earlier post so you can see that all I did was remove a section. Thanks for your help! :)
'Show the file on the web pageDim bytByteStream()AsByte
'ms.Seek(0, SeekOrigin.Begin) ReDim bytByteStream(CType(ms.Length,Integer) - 1) ms.Read(bytByteStream, 0,CInt(ms.Length)) 'Dim count As Integer = 0 'While count < ms.Length ' '>>Following line produces error: ' ' "Value was either too large or too small for an unsigned byte." ' bytByteStream(count) = Convert.ToByte(ms.ReadByte()) ' '>>also tried this which did not work ' ' "Arithmetic operation resulted in an overflow." ' 'bytByteStream(count) = ms.ReadByte() ' count += 1 'End While Response.AddHeader("Content-Type","application/pdf") Response.AddHeader("Content-Disposition","inline;filename=def.pdf")Response.BinaryWrite(bytByteStream)
Well, I was wondering why you seemed to be filling the Byte array and then refilling it in the loop, but I guess I got side-tracked on the MemoryStream thing. Glad you got it.
NC...
Taking the website offline
Hi
Imagine, I want to update my website and I want to tell the users of the website (when they visit the site during the updat) that they will be unable to use the site for an hour. During the update, the users should be able to use the website
How can I achieve this?
regards
In the start even for the session redirect them to a page that says the site is off-line, and in that page's code abandon the session.you do or don't want them to be able to use the site?
You could put a redirector in, or simply replace the defailt.aspx page.
Curt_C wrote:
you do or don't want them to be able to use the site?
You could put a redirector in, or simply replace the defailt.aspx page.
The problem with replace default.aspx etc is that the user might come in via a bookmark that hits a direct page. By hijacking their first request via session_onstart you can guarantee they'll go to your offline page, and by abandoning the session in that page their next request to go someone in your site will result in the same behaviour.
Check out this neat feature of 2.0
http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx