|
public Image ExportPageAsImage(string pdffileName,int pageNumber)
{
PDFWrapper m_pdfWrapper=new PDFWrapper();
PDFPage m_page;
m_pdfWrapper.LoadPDF(pdffileName);
m_dpi = 96;
m_page = this.m_pdfWrapper.Pages[pageNumber];
Bitmap bmp = m_page.GetBitmap(m_dpi);
return (Image)bmp;
}
RVN
|
|
|
|
|
I need to change ReadOnly from false to true for one column in GridView depending on who the user is. In my particular case it is a BoundField (also I would like to know how to do it for a Template field as well) and DataField is "dteRequired". I would like to code something like that right in the Page_Load handler:
GridView1.Columns["dteRequired"].ReadOnly = true;
but I am getting compile errors...
Any idea?
Thank you.
|
|
|
|
|
For your requirement, use ItemTemplate Field and in have a Textbox and Label
and according to the user, show/hide either label or textbox in rowdatabound of gridview
|
|
|
|
|
You need to to do this in the RowCreated event.
Use something like this (adjust to suit):
protected void Grid1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e == null) { throw new ArgumentNullException("e"); }
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].ReadOnly = false;
}
}
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
How can I generate a random string of given length in an asp.net web page ?????/?
|
|
|
|
|
int length = 10;
string output = string.Empty;
char c = new char();
Random rnd = new Random();
do
{
c = Convert.ToChar(rnd.Next(Char.Parse("z")));
if(Char.IsLetter(c))
{
output += c;
}
} while(output.Length < length);
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have a asp radiobutton on my page and when I display the page it appears that the border for the radiobutton is 50px and the text for the radiobutton is shoved down to the next line. I have the markup for the radiobutton below. When I use a standard HTML radiobutton it appears correctly on the page. See markup below:
Select a button
<asp:radiobutton id="radio2" runat="server" width="20px" text="Milk">
Any help would be great!
Thanks,
Steve
|
|
|
|
|
Steve Holdorf wrote: <asp:radiobutton id="radio2" runat="server" width="20px" text="Milk">
The width that you set here is too less.It must be atleast 50px according to your text.Try with the width as
Width="50px"
Let me know if any doubts.
|
|
|
|
|
OK, I moved the radiobutton out of all my div's using css and still get the same thing. The border is still about 50px and the text displays on the next line. when I select the area around the button I can see it's box and the border is wide. ???????
|
|
|
|
|
Steve,
If you give your width little bit large it will work fine. I have tested with 50px Its coming properly withput having any issue.
Now, If you have changed the width and still faceing the same problem, then I guess you have some problem with CSS.
See, when you are using RadioButton is aspx page, its renders as follows :
<asp:RadioButton ID="RadioButton1" runat="server" Width="50px" Text="milk" />
Render as :
<span style="display: inline-block; width: 50px;">
<input id="RadioButton1" type="radio" value="RadioButton1" name="RadioButton1"/>
<label for="RadioButton1">milk</label>
</span>
Which may causes the problem. So please check you css for input and label conntrol.
One alternatvie soluation that you can go for is, use Table. Put Radiobutton in one one Cell and data in other cell. Hope you got my point.
Please let me know if you have any issue.
Thanks !
Cheers !
Abhijit
<b>My Blog :</b> <a href="http://abhijitjana.net">http://abhijitjana.net</a>
|
|
|
|
|
In my css I had a input element with width=200px and when I commented it out it worked. CSS can make your pages great but can also be a pain. Thanks for all of the advice guys.
Steve Holdorf
|
|
|
|
|
Yes, sometimes its creates pain and very difficult to find out too.
Thanks !
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi all,
I am looking for an e-learning platform (opensource)in asp.net where I can develop the e-learning applications with scorm compatibility.
Any idea about it,
thanks in advance
|
|
|
|
|
|
I am using asp.net 2.0 and ajaxPro in my web application.
1. How can bind my dropdown inside ajaxPro method, without using HtmlTextWriter?
Is it possible?
All the server controls are null inside the ajaxPro method.
2. So, i have created dynamic server controls inside the ajaxPro method and used HtmlTextWriter and rendered in javascript. Here in javascript, i can't able to get this dynamic controls by using getElementId method.
document.getElementId(asp.net control id + "ControlId");
but it returns null.
thanx in advance!
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
jeneesh k. wrote: How can bind my dropdown inside ajaxPro method
You can't, databinding is done during page rendering by the ASP.NET engine.
jeneesh k. wrote: All the server controls are null inside the ajaxPro method.
Of course they are. You need to understand the page lifecycle and ajax calls.
Basically, you seem to have no clue about what Ajax is and how to use it. Please do us all, including yourself, a favor and research and understand the technology before trying to use it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi, I have to make server calls from client side by taking the value from first combo need to populate the second one. dont use selected change event.
How it is possible????
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
I would recommend moving to ASP.NET AJAX which is built into
Visual Studio 2008 and available as additional feature pack for
Visual Studio .NET 2005. It provdes an update panel which can
bind your controls during an ajax call, here is a simple example ...
<%@ Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Items.Clear();
String[] ds = {"hi","sup"};
DropDownList1.DataSource = ds;
DropDownList1.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
#UpdatePanel1 {
width:300px; height:100px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="padding-top: 10px">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
</div>
</form>
</body>
</html>
|
|
|
|
|
Hi, i know update panel. I have to make server calls from client side by taking the value from first combo need to populate the second one. dont use selected change event.
How it is possible????
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
<%@ Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Items.Clear();
String[] ds = {"hi RED","sup RED"};
String[] ds1 = { "hi BLUE", "sup BLUE" };
if (DropDownList2.SelectedValue == "RED")
{
DropDownList1.DataSource = ds;
DropDownList1.DataBind();
}
if (DropDownList2.SelectedValue == "BLUE")
{
DropDownList1.DataSource = ds1;
DropDownList1.DataBind();
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
#UpdatePanel1 { width:300px; height:100px; } </style>
</head>
<body>
<form id="form1" runat="server">
<div style="padding-top: 10px">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>RED</asp:ListItem>
<asp:ListItem>BLUE</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
</div>
</form>
</body>
</html>
|
|
|
|
|
Hi
update panel not working in asp.net 3.5 as it was working in asp.net 2.0.
may be because of I'm not able to make setting for httpHandlers and httpModules in web config in asp.net 3.5.
regards
Hari
You get the best out of others when you give the best of yourself.
|
|
|
|
|
What are you talking about? Why can't you make changes to the web.config? It appears you have other problems with your application/environment.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
when I put setting on web config:
<system.webServer>
<handlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</handlers>
<modules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
</system.webServer>
eroor:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
You get the best out of others when you give the best of yourself.
|
|
|
|
|
These are not correct for 3.5 project so of course it isn't working.
Version=1.0.61025.0 = ASP.NET 2.0
Version=3.5.0.0 = ASP.NET 3.5
I would suggest you create a new 3.5 project and compare the web.config files
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Dear All,
I am doing a scienero where I have dropdownList which is binded to datasource.
I want that based on selectedIndex it should do postback only once.
as for example
If the new SelectedIndex is 1 then it sould do a postback retreive all data from datasource based on selectedIndex. for the 2nd time If I select index 1 then It should not do postback but I want to store items in client side as the first index is selected at some var. and then every time new index is selected it should do postback then save binded items at some var.
any ideas?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|