|
Hi,
I am new comer to .Net.
I am developing a simple application in C# and Asp.In that application I have to write the code to download a software from particular site and the code to install that software in our system.I don't have any knowledge on how to create set up file,code to download, .Exe file etc.
Please anyone Help me.I will be very thankful to them.
Thanks in Advance
|
|
|
|
|
you can't install a program from ASP.NET. You download a file by providing a link to it, or if you prefer, using Response.BinaryWrite to pass it back from a page.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Please search the Internet before posting questions like the above.
If you are a newcomer to aspnet the search for tutorials
We are not a Code Charity
|
|
|
|
|
Dear all ,
I am using C# ,asp.net2.0
I am making question list (as question are dynamic) I list in gridview and inside gridview dropdownlist populated with possible response.
Now I have to fetch each row of gridview and user response against it on button click outside of gridview
Please suggest some link or ideas
Thank you
regards
imran khan
|
|
|
|
|
Try it..Wait for good Solution...
Under button Click
for(int i=0;i<=gridview.rows.count-1;i++)
{
string answer=gridview.rows[i].cells[index].text;
}
|
|
|
|
|
I am using a dll, itextShart.dll
To export data to PDF files
It works fine in my local system but on uploading this to the
Server I am getting an error
As bellow
Could not load file or assembly 'itextsharp, Version=4.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The module was expected to contain an assembly manifest. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'itextsharp, Version=4.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The module was expected to contain an assembly manifest.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'itextsharp, Version=4.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' could not be loaded.
WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
What can I do
To work things fine
Kodee
|
|
|
|
|
Looks like you didn't copy the manifest file to the server.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for answering Christi.
Can u tell me what is the manifest file and where can i find that file.
I have downloaded the itextsharp.dll file and im uploading the same to the server.
Kodee
|
|
|
|
|
i wrote this code does any body know why is it wrong ? how should i write yhis:currentUser.IndexOf("\")
string currentUser = WindowsIdentity.GetCurrent().Name;
currentUser = currentUser.Substring(currentUser.IndexOf("\") + 1);
|
|
|
|
|
Well, why do you tink it's wrong ? You don't tell is if there's an error, if there's a wrong result, or what.
First problem: \ is used to escape things. So , \" puts a quote in the string, it does not equate to a \ in quotes. "\\" or @"\" is what you need
Second problem: this code assumes that there's a character after the slash in currentUser. If not, it will blow up.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
so thanks , that write i wrote ""\"" and its right.
|
|
|
|
|
hi i am creating the hyperlink column like this ........
HyperLinkColumn hlpField = new HyperLinkColumn();
hlpField.DataTextField = "test";
hlpField.HeaderText = "test";
datagrid.Columns.Add(hlpField);
and now i want to give the url to this hyperlink field in the itemdatabound event......
how can i do this
|
|
|
|
|
Why are you adding it in code instead of in the aspx ?
You can subscribe to the itemdatabound event and look for hte column there, but it would be better to build a template that just builds the URL
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
instead of using hyperlink column, use linkbutton. find attached the code below.
aspx file code:
---------------
<asp:DataGrid DataKeyField="event_id" ID="eventsGrid" runat="server" CssClass="textbld"
AllowSorting="True" AutoGenerateColumns="False" Width="518px" OnItemDataBound="eventsGrid_ItemDataBound"
AlternatingItemStyle-CssClass="alternativeTxt" BorderColor="White" BorderStyle="Solid"
BorderWidth="1px" CellPadding="0" HorizontalAlign="Left" >
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditItemStyle BackColor="#2461BF" />
<SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<AlternatingItemStyle CssClass="alternativeTxt" />
<ItemStyle HorizontalAlign="Left" CssClass="itemTxt" />
<Columns>
<!-- Use the below variable event_id as hidden variables from the database-->
<asp:BoundColumn DataField="event_id" Visible="False"></asp:BoundColumn>
<!-- bind the hidden variable (event_id) value to the link button using "Eval" function-->
<asp:TemplateColumn HeaderText="Ort" HeaderStyle-CssClass="padlist">
<ItemTemplate>
<asp:LinkButton ID="lnkCity" runat="server" CommandArgument='<%# Eval("event_id") %>'
OnCommand="lnkCity_Command" CssClass="Blacklink"></asp:LinkButton>
</ItemTemplate>
<ItemStyle CssClass="eventsTxt" />
</asp:TemplateColumn>
</Columns>
<HeaderStyle CssClass="head_txt Head_R1" />
</asp:DataGrid>
.cs file code:
---------------
In the onclick event of the linkbutton in the datagrid, give the link url as below.
protected void lnkCity_Command(object sender, CommandEventArgs e)
{
Response.Redirect("Popup.aspx");
}
Kodee
|
|
|
|
|
Hello Friends,
I want to use the my Public property values in my destination page using the Cross-Page Posting
Page1.aspx
public string myName
{
get
{
return txtName.Text;
}
}
Page2.aspx
<%@ PreviousPageType VirtualPath="~/Page1.aspx" %>
and to use the value of myName property in Page2.aspx i'm using the following code
txtName.Text = PreviousPage.myName;
or
Rough1 myRough;
myRough = (Rough1)PreviousPage;
txtName.Text = myRough.myName;
but it's throwing an error "Object reference not set to an instance of an object"
|
|
|
|
|
Which line throws the error ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
txtName.Text = PreviousPage.myName;
this line throwing the error
|
|
|
|
|
Rough1 myRough;
myRough = (Rough1)PreviousPage;
txtName.Text = myRough.myName;
Line 2 would throw if it failed, so I assumed txtName is null. Where are you calling this code and where does txtName come from ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Actually i've two textbox named "txtName"
first textbox bringing the name from the Page1 through the property named "myName" and second textbox which is also showing the name entered in the first textbox.........................
even i've mentioned all my code in my first request
|
|
|
|
|
you need to buy a book on C# and one on ASP.NET. You plainly do not realise that where you call your code, can make a difference. It can.
The issue is, the control is null. If you don't want to work with us to work out why, then we can't help you
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
.NET- India wrote: but it's throwing an error "Object reference not set to an instance of an object"
You can also get previous page's control value by using findcontrol method.
You need not use property.
for example
txtName.Text = ((TextBox)PreviousPage.FindControl("txtName")).Text;
Regard
Imran Khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Yeah, but FindControl is a hack, surely ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Because he told you another way to do the same thing. What's needed here is more detail so we can see what you're doing here that causes this not to work. I think that your textbox variable is null, now we need to work out why. In general, you should use the debugger before asking here, then you'd have this sort of detail to give us from the start, or maybe even solve your own problem
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yes sir it's not brining the value from Page1 but i'm transferring the value so what should i do know
|
|
|
|