|
Hi Ketan,
Thank you very much sir.
But I am working on Share Point server. And this functionality i have to add in my WebPart.I am facing hard time for this problem.If you can help me, it will be really great.
Thank you very much ketan for your help.
NIKI
|
|
|
|
|
Well, I dont know anything about Share Point server, I am sorry I cant help now anymore.
Regards,
Ketan
|
|
|
|
|
Hi,
i have a page by name public class webform1: System.Web.UI.Page (webform)
which is basically a page which dynamically generates controls .The users
have to inherit the page if they want the same format of the default page (controls)
so what i did in webform 2 was
public class webform2 : webform1
in the webform1 i have declared the place holder pl1 where i have all the controls pushed in .On running webform2 i dont see the controls present in webform1.(webform1 is running fine with cntls being displayed)
pls help me out
|
|
|
|
|
You may consider using the MasterPage which supports visuality inheritance and it's much simpler.
|
|
|
|
|
You are inheriting the class, but not the contents of the .aspx file.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Since the placeholder is declared in the code behind then why is it not displaying.
Is there a way out to inherit the controls(in .net 1.0) from one page to another so that we can use it as a master page as in .net 2.0.
|
|
|
|
|
What you declare in code behind is only the reference to the control, not the control itself.
---
b { font-weight: normal; }
|
|
|
|
|
Scenario: I was using Template columns with ImageButtons with no problem controlling the columns' width. However template columns are not allowed when 'EnableSortingAndPagingCallbacks="True"'.
Original html code:
<asp:TemplateField ItemStyle-Width="22px">
<ItemTemplate>
<asp:ImageButton ID="imbView" runat="server" ImageUrl="~/Images/ViewSearch.gif" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="22px">
<ItemTemplate>
<asp:ImageButton ID="imgEdit" runat="server" ImageUrl="~/Images/Edit.gif" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="22px">
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" ImageUrl="~/Images/Delete.gif" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="22px">
<ItemTemplate>
<asp:ImageButton ID="imgPrint" runat="server" ImageUrl="~/Images/Print.gif" />
</ItemTemplate>
</asp:TemplateField> So I replaced the template columns with HyperLinkField. Then in the onRowDataBound event in the code-behind, I set the images to the respective links.
</asp:HyperLinkField DataNavigateUrlFormatString="~/Invoices/Invoice.aspx?id={0}&Readonly" DataNavigateUrlFields="InvoiceID" ItemStyle-Width="20px" />
</asp:HyperLinkField DataNavigateUrlFormatString="~/Invoices/Invoice.aspx?id={0}&Edit" DataNavigateUrlFields="InvoiceID" />
</asp:HyperLinkField DataNavigateUrlFormatString="~/Reports/Reports.aspx?DeleteFromSomeWhere" DataNavigateUrlFields="InvoiceID" />
</asp:HyperLinkField DataNavigateUrlFormatString="~/Reports/Reports.aspx?id={0}" DataNavigateUrlFields="InvoiceID" />
public void dgData_onRowDataBound(Object src, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView row = (DataRowView)e.Row.DataItem;
HyperLink link = (HyperLink)e.Row.Cells[0].Controls[0];
if (!(link == null))
{
link.ImageUrl = "~/Images/ViewSearch.gif";
link.ToolTip = "Print";
}
link = (HyperLink)e.Row.Cells[1].Controls[0];
if (!(link == null))
{
link.ImageUrl = "~/Images/Edit.gif";
link.ToolTip = "Print";
}
link = (HyperLink)e.Row.Cells[2].Controls[0];
if (!(link == null))
{
link.ImageUrl = "~/Images/Delete.gif";
link.ToolTip = "Delete Invoice";
link.Attributes.Add("onclick", "javascript: alert('works'); return false;");
}
link = (HyperLink)e.Row.Cells[3].Controls[0];
if (!(link == null))
{
link.ImageUrl = "~/Images/Print.gif";
link.ToolTip = "Print Invoice";
}
}
}
After the changes, which fixes the EnableSortingAndPagingCallbacks problems, the column images (ViewSearch, Edit, Delete & Print) are spaced apart instead of nicely next to each other. I have tried the following variations with no luck.
if (!(link==null))
{
link.ImageUrl = "~/Images/ViewSearch.gif";
link.ToolTip="Print";
link.Width = System.Web.UI.WebControls.Unit.Pixel(20);
e.Row.Cells[0].Style.Add("max-width", "20px");
e.Row.Cells[0].Style.Add(System.Web.UI.HtmlTextWriterStyle.Width, "20px");
e.Row.Cells[0].Width = System.Web.UI.WebControls.Unit.Pixel(20);
}
and also
<asp:HyperLinkField ... ItemStyle-Width="20px" ControlStyle-Width="20px"/>
Thanks in advance,
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
-- modified at 17:18 Thursday 29th June, 2006
|
|
|
|
|
Hi Michael,
There are a couple of ways which you can try:
+ Use Atlas with your GridView control, you can keep using the TemplateField and simply place the GridView control inside the UpdatePanel to support client callback with paging and sorting.
+ Use the ButtonField with ButtonType="Image" :
<asp:ButtonField ItemStyle-Width="22px" ButtonType="Image" ImageUrl="..." />
+ Use the BoundField with adding the ImageButton to the column in the RowDataBound event handler:
<asp:BoundField ItemStyle-Width="22px" />
|
|
|
|
|
I ended up going with the Atlas:UpdatePanel.
Thanks!
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
Hi all
I am trying to on mouseover display name and put it in session (IN HTML PAGE)
MYCODE
--------
shape=RECT coords=228,232,441,279 href=hs22.aspx>
------------------
Can any one tell me how can i put the value in session
THX
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
-- modified at 15:05 Thursday 29th June, 2006
|
|
|
|
|
You can't access the Session object from client script. You have to send the value to the server, so that the server code can put it in the session variable.
---
b { font-weight: normal; }
|
|
|
|
|
You may consider using AJAX to send a request to the server to persist the value in the Session object.
|
|
|
|
|
Hi,
I am Ravindra,currently doing a web application
consisting of :
1.Login.aspx
2.Mails.aspx
and other web forms
when I type the url : http\\localhost\Mails.aspx ,it is directly opening that web page
without displaying Login.aspx web page.
I want to restrict the mails.aspx page until the user logins with Login.aspx,
and also mails.aspx page is to be restricted even the user types the
url(http\\localhost\Mails.aspx)
please help me ,I am new to ASP.net.
ravindra donkada
|
|
|
|
|
Simple Forms Authentication
Basically, you need to configure forms authentication and set access rules on different pages or directories to tell the server which pages are registricted.
-- modified at 15:41 Thursday 29th June, 2006
LINK: Made link
|
|
|
|
|
Simply assign some value to a session variable in login Page say..
Session("login")="admin"
And on Mail.aspx page check
If Session("login")="" then
Response.redirect("login.aspx")
else
Your page code here
end if
Lets work it Out.........!
|
|
|
|
|
Hello,
I am using FormsAuthentication and Membership in ASP.NET 2.0 Applicaion. On Login page I have a link to page saying, Forgot password. On click of this link it should lead me to ForgotPassword.aspx page. The problem is, everytime I click on this link, system takes me back to Login page. To reach to that page I have to be logged in, which is not the requirement.
Had anyone have idea, how to mitigate this problem.
Thanks in advance.
- ashish
|
|
|
|
|
Move that page out of the protected area. Or use could use the admin tool to set the access rules on it, or you may be able to do it in Web.config in <location> tags, but I'm not sure if that will work with the Membership stuff.
|
|
|
|
|
Like eggsovereasy said, you can use the
location[^] tag to configure the authorization which allows all users to access this page. You can find the sample settings from the link.
|
|
|
|
|
I want to check whether gridview contain any row so that if grid view is empty i can print appropriate message.
Note that gridview1.rows.count doesn't work.
aLi
|
|
|
|
|
Try setting the EmptyDataText property on the gridview. It is a message to display if the gridview is empty.
|
|
|
|
|
With the GridView control, you can use EmptyDataText or EmptyDataTemplate to display your message or whatever you want when the datasource is empty.
GridView Members[^]Last modified: Thursday, June 29, 2006 10:12:40 PM --
|
|
|
|
|
I have a Content Page with a Custom Content Place holder. How do I get my functions that do various calculations in the code behind page to show up in the Custom Content Area at runtime? Thanks.
|
|
|
|
|
Perhaps, I don't undertand what you mean with your Custom Content Place holder and Custom Content Area, but basically you can place a container in the content area and in code-behind you can call your functions to populate and assign the values to the container. More details could help.
|
|
|
|
|
Hi
Can any one tell me where i can get a koool but free shoping cart in ASP.net.
Note: i am using VB.net
Thanks in advance
Lets work it Out.........!
|
|
|
|