|
private static ImageCodecInfo GetImageCodec(string Ext)
{
switch (Ext)
{
case ".jpg":
return ImageCodecInfo.GetImageEncoders()[1];
case ".gif":
return ImageCodecInfo.GetImageEncoders()[2];
case ".bmp":
return ImageCodecInfo.GetImageEncoders()[0];
case ".png":
return ImageCodecInfo.GetImageEncoders()[4];
case ".jpeg":
return ImageCodecInfo.GetImageEncoders()[1];
case ".tif":
return ImageCodecInfo.GetImageEncoders()[3];
case ".jpe":
return ImageCodecInfo.GetImageEncoders()[1];
case ".jfif":
return ImageCodecInfo.GetImageEncoders()[1];
case ".tiff":
return ImageCodecInfo.GetImageEncoders()[3];
default:
return ImageCodecInfo.GetImageEncoders()[1];
}
}
Regards
Keyur Satyadev
|
|
|
|
|
Hi!!
I'm trying use this code but does not working.
Please help me.
Simply does not work, not of error but also does not work.
public void carregarImagem()
{
string path = "~/imagens/" + FileUpload1.FileName;
string folder = "~/imagens/";
string nome = FileUpload1.FileName;
int largura = Convert.ToInt32(w.Text);
int altura = Convert.ToInt32(h.Text);
string ext = System.IO.Path.GetExtension(FileUpload1.FileName);
string name = "~/imagens/" + FileUpload1.FileName;
Resize(picImage.ImageUrl, nome, largura, altura, ext, folder);
//used to show image
picImage.ImageUrl = name;
}
|
|
|
|
|
|
I'm tring to use this function "CreateThumbnail", but dosen't work.
Just dont show me nothing.
Please.
|
|
|
|
|
i want to save items in listbox without using data base.how it is possible
|
|
|
|
|
Use "Session" if you want it on multiple page or through out the site.
Regards
Keyur Satyadev
|
|
|
|
|
|
Thats really Basic stuff.. Hope u must start reading a good book....
|
|
|
|
|
Hi,
I am developing a solution using MVC frame work and now I see that I have top heavily depend on the HTML Helper class and I am not using any of the server objects. It takes lot more time to do any thing now wrt server controls.
How can I introduce/use server controls with out breaking the MVC gudelines.
Regards,
Pavas
|
|
|
|
|
i am very new in aspdotnetstorefront and want to change skin of storfront
from manual of aspdotnetstorefront i try to follow steps to change skin but i have to face many problems and still unable to change skin
please guide me how i can change skin
i have html and css pages
Regards
|
|
|
|
|
You have to be familiar with XSLT before you can effectively skin ASPDNSF. Trust me, I've been down that road of hell before.
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
i have read XSLT but still unable to decide how i should start and how should take first step to change skin.
i am trying to change skin of home page and i am working with template.aspx and style.css which are in skin folder
please can you tell me few tips or steps
Thanks
Best Regards
|
|
|
|
|
Ok, here's my problem. I have two pages: one called FirstPage.aspx and the other one called SecondPage.aspx. Here's what I want to do... I start with FirstPage.aspx and here I have a button and when I click it SecondPage.aspx appears. I do that using Response.Redirect("SecondPage.aspx", false). Ok, now when it loads the second page I want to show in a label the name of the first page. How can I do that? If I have used the PostBackUrl property of the button from the first page, this would have been easy. I would have written in the SecondPage:
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (PreviousPage != null)<br />
{<br />
Label1.Text = PreviousPage.Title;<br />
}<br />
<br />
}<br />
But, I need to show the second page using Response.Redirect("SecondPage.aspx", false). So any help?
|
|
|
|
|
Just pass the value using Querystring...
Do like this when you navigate to the second page:
Response.Redirect("secondpage.aspx?name=" + pagename);
After you redirect, you will find the value of name easily.
In Page_load :
protected void Page_Load(object sender, EventArgs e)
{
string firstpagename = Request.QueryString["name"];
Label1.Text = firstpagename;
}
I think this is what you needed.
Cheers.
|
|
|
|
|
I am using AJAX control toolkit Accordion control on my page.
In accordion pane i have added one pane and in that pane i put some header and content. My code below shows for header and content
<Header>
<div style="float: left; width: 100%;" class="head4">
1. Household Size</div>
</Header>
<Content>
<div style="float: left; width: 50%; background-color: #a9d4ff;">
<asp:Label ID="lbl_Stud_HouseholdSize" runat="server" Text="5"></asp:Label>
</div>
<div style="float: left; width: 50%; background-color: #afffaf;">
<asp:Label ID="lbl_Parent_HSize" runat="server" Text=""></asp:Label></div>
<div style="float: left; width: 50%; background-color: #a9d4ff;">
<div style="float: left; width: 100%;">
<asp:RadioButtonList ID="rd_Shouseholdsize" runat="server" RepeatDirection="Horizontal"
Width="70px" AutoPostBack="True" OnSelectedIndexChanged="rd_householdsize_SelectedIndexChanged">
<asp:ListItem Value="1">Valid</asp:ListItem>
<asp:ListItem Value="0">Correction</asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
</Content>
The problem is when i execute, it does not show anything in pane. Just show the headers.
Any solution will be helpfull.
|
|
|
|
|
look at below link you will get the solution.
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Accordion/Accordion.aspx
Regards
Keyur Satyadev
|
|
|
|
|
Here's a sample that works for me. This is one of my accordian snippets from an Ajax-enabled web project. Take a look - you might see something that you have missed. Also, check your CSS - make sure you don't have bugs in there - something that might be hiding a div for example.
<ajaxToolkit:Accordion ID="ajax_acc_Reports" runat="server"
HeaderCssClass="accordionheader" HeaderSelectedCssClass="accordionheader-selected"
SelectedIndex="-1" AutoSize="None" FadeTransitions="true" TransitionDuration="250"
FramesPerSecond="40" RequireOpenedPane="false" SuppressHeaderPostbacks="true">
<Panes>
<ajaxToolkit:AccordionPane ID="apnAnalysis" runat="server" ContentCssClass="accordionpane-selected">
<Header><strong>Analysis</strong></Header>
<Content>
<ul><li><a href="Reports/Analysis/July_09.pdf" title="QA July 09 Report"
target="_blank">QA July 09 Report</a></li></ul>
</Content>
</ajaxToolkit:AccordionPane>
</Panes>
</ajaxToolkit:Accordion>
Please let me know if this does or does not help you
|
|
|
|
|
Here's my problem: I have a button and when I click it I want to open a new page. I know that I can do this thing very easy by setting the PostBackUrl property of the button. But here's what I want to do: on my page I have a textbox and, for example when I press the button I want to test the text from the TextBox and if it's ok I want to show the new page; if not I want to display a message. I want to do that using c# language, and not JavaScript. I've tried this:
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
if (TextBox1.Text == "something")<br />
Button1.PostBackUrl = "NewPage.aspx";<br />
else<br />
....................<br />
<br />
}<br />
<br />
Ok, everithing is fine until now. But when I press the button, assuming that in my textbox I've written "something", the NewPage isn't displayed. My current page is loaded again and when I press the button again then NewPage.aspx is displayed. And I don't know why this is happening.
Can anyone help me please?
|
|
|
|
|
Try:
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "something")
{
Response.Redirect("NewPage.aspx");
}
else
{
....................
}
}
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
"Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
|
|
|
|
|
I think he wants to "Postback" to a new page and not re-direct to a new page.
|
|
|
|
|
The Postback url defaults to the current page and this is where your first click will return to, because, at this first click point your browser doesn't know to postback to NewPage.aspx. Only on the second click (after you've set Button1.PostBackUrl = "NewPage.aspx") will you get postback to the new page.
IF YOU NEED TO POSTBACK TO A DIFFERENT PAGE THEN....
you can't avoid using javascript. Setting PostBackUrl on the server won't affect the current request (your first click).
IF YOU'RE NOT REALLY CONCERNED WITH POSTBACK THEN....
do what the other guys suggested and replace the Button1.PostBackUrl = "NewPage.aspx" with the ReDirect, or Server.Transfer("NewPage.aspx"); code.
|
|
|
|
|
Here's my problem: I have a button and when I click it I want to open a new page. I know that I can do this thing very easy by setting the PostBackUrl property of the button. But here's what I want to do: on my page I have a textbox and, for example when I press the button I want to test the text from the TextBox and if it's ok I want to show the new page; if not I want to display a message. I want to do that using c# language, and not JavaScript. I've tried this:
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
if (TextBox1.Text == "something")<br />
Button1.PostBackUrl = "NewPage.aspx";<br />
else<br />
....................<br />
<br />
}<br />
<br />
Can anyone help me please?
|
|
|
|
|
if i understand you correctly , when the Textbox value is equal to what you want a use to be transfered to another page else show the message(Error), if so , then you can do it this way
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "something")
{
Response.Redirect("NewPage.aspx",false);
}
else
{
}
}
Hope this is what you are looking for. One more thing , Dont post the same thing twice , its not allowed here.
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/
|
|
|
|
|
Hi,
I am working on a asp.net application. In this I want a javascript function which have to invoke Anchor tag click event without clicking in asp.net.
If anyone have any idea to do this please reply me.
Thanks in advance.
|
|
|
|
|