|
I'll try this method and see if it works for my scenario. thanks
ASP all the way
|
|
|
|
|
hi,
i have a we application and i have different settings for this application,
now i need multiple web.config files in the application,
how i can reference to those web.config files melodramatically at run time that which one's settings is going to be used this time,
can any body explain it please,
|
|
|
|
|
|
The usage of multiple configuration file makes the application more secure and manageable.
In the following tutorial you can learn how to use multiple web.config files in your application.
Regards,
Jamil
|
|
|
|
|
Hi, I want to return selected items (check box list) on button click of a user control to the parent page.
How do I do this ? The checked items would be in form of List<>.
I have made the user control but don't know how to pass an input id to it to fetch the records and on button click, return them.
|
|
|
|
|
Just make one public method of your user control
which returns List<> items [Contains selected items].
That's it. You need to access that particular method once
button click is over.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Update:
Ok, I created two public properties, now I want to return the selected checkbox items in the checkbox list and return them on button click so I used a foreach, not much sure about my approach.Here is how its looking now. How to bind the results with parent page gridview on user control button click ?
public partial class assets_WebControls_ftExclusions : System.Web.UI.UserControl
{
private int id;
private ftExclusionsList myftExclusions;
public int ID
{
get{return ID;}
set{ID=value;}
}
public ftExclusionsList selectedExclusions
{
get { return myftExclusions; }
set { myftExclusions = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
cblExclusions.DataBind();
ftExclusionsList myExcluList = ftExclusionsManager.ftExclusionsById(ID);
if (myExcluList != null)
{
if (myExcluList.Count > 0 && myExcluList != null)
{
foreach (ftExclusions ex in myExcluList)
{
cblExclusions.Items.FindByValue(ex.excluId.ToString()).Selected = true;
}
}
}
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
ftExclusionsList myFTExclusionList = new ftExclusionsList();
foreach (ListItem li in cblExclusions.Items)
{
if (li.Selected == true)
{
ftExclusions myftExclusion = new ftExclusions();
myftExclusion.ftExcluId = Convert.ToInt32(li.Value);
myftExclusion.excludesc = li.Text.ToString();
myFTExclusionList.Add(myftExclusion);
}
}
selectedExclusions = myFTExclusionList;
}
}
modified on Friday, May 28, 2010 7:53 AM
|
|
|
|
|
Hi
I want to make my website url like
www.websitename.com/username
Just like twitter in which we have
twitter.com/username
How to achieve this
Please help
Thanks in advance
|
|
|
|
|
|
hi to all,
i am new in asp.net,
i want to create parameterised crystal report. i did it i create parameter "Empid " using "Parameter Fields"
then i want to show the report on click event of button so code is as follows,
<br />
Protected Sub btnShow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShow.Click <br />
Dim ConnInfo As New ConnectionInfo <br />
With ConnInfo <br />
.ServerName = ".sqlexpress" <br />
.DatabaseName = "Northwind" <br />
.UserID = "sa" <br />
.Password = "" <br />
End With <br />
<br />
Me.CrystalReportViewer1.ParameterFieldInfo.Clear() <br />
If Me.txtEmployeeID.Text.Trim.Length > 0 Then <br />
Me.CrystalReportViewer1.ReportSource = Server.MapPath("SampleParam1.rpt") <br />
Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo <br />
Dim p_EmpID As New ParameterField <br />
p_EmpID.Name = "p_EmployeeID" <br />
Dim p_EmpID_Value As New ParameterDiscreteValue <br />
p_EmpID_Value.Value = Me.txtEmployeeID.Text <br />
p_EmpID.CurrentValues.Add(p_EmpID_Value) <br />
ParamFields.Add(p_EmpID) <br />
Else <br />
Me.CrystalReportViewer1.ReportSource = Server.MapPath("SampleRpt01.rpt") <br />
End If <br />
<br />
For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo <br />
cnInfo.ConnectionInfo = ConnInfo <br />
Next <br />
Me.CrystalReportViewer1.RefreshReport() <br />
End Sub <br />
i am using sql2000, but after the clicking on button it will show me an error ,"Object Reference not set to an instance of an object".
why i gives me error?
is the servername is wrong? what the name should i provide? my database is on another computer and i am accessing it through networking
the name of the computer is "RS1" so should i give the servername="RS1"
if i debug the code , CrystalReportViewer1.LogOnInfo have count=0.
what is error?
|
|
|
|
|
i have below code.
string strTest = "Codes";
Response.Redirect("default2.aspx?jungPara="+strTest+"");
but client received address by get method so all of parameters can be displayed.
so i fix method to post.
<form method="post"
but i does't work by post.
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Try this:
<form method="post" name="customerlinkform">
Then put the customerlinkform.submit() in a button.
Doing so should hide the querystring.
|
|
|
|
|
hi,
When the source page uses the HTTP POST action to navigate to the target page, you can retrieve posted values from the Form collection in the target page. Note that you can get only the post values; you cannot read the values of arbitrary controls on the page.
To get the values of controls from the source page in another application
1. In the source page, include a form element that contains HTML elements (such as input or textarea) or ASP.NET server controls (such as TextBox or DropDownList controls) that post values when the form is submitted.
2. In the target page, read the Form collection, which returns a dictionary of name/value pairs, one pair for each posted value.
The following code example displays the ID and value of every posted control in the source page and displays the posted values in a label named Label1.
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load
Dim displayValues As New StringBuilder()
Dim postedValues As NameValueCollection = Request.Form
Dim nextKey As String
For i As Integer = 0 To postedValues.AllKeys.Length - 1
nextKey = postedValues.AllKeys(i)
If nextKey.Substring(0, 2) <> "__" Then
displayValues.Append("<br>")
displayValues.Append(nextKey)
displayValues.Append(" = ")
displayValues.Append(postedValues(i))
End If
Next
Label1.Text = displayValues.ToString()
End Sub
For more help refer following link...
http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx[^]
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi,
There is an initiative to upgrade browser on desktop from IE 6 to IE 8. As part of this initiative, all web based applications need to be remediated/tested in order to ensure that they work correctly in IE8. Please let me know on how we can identify the impacted web applications due to this initiative.
Please share if there is any standard approach or tools to address such requirement.
Kindly redirect me to any tool which will solve this purpose.
Thanks in advance.
Regards,
Riz
|
|
|
|
|
There should no impact Ideally when you upgrade your browser if you(and all your 3rd party tools) have not used any depreciated javascript code.
But, still testing the javascript part only should be sufficient. Moreover, you might get a few alignment issue depends on the way you have written your html code.
Hope this will help.
|
|
|
|
|
|
Hallo, I am completely new in ASP.Net and I want to pass the data from a simple SELECT into the Attributes of an Object. The Class has similar attributes as the DB-Table. Where should I look to learn how to do that? Is there already a standard procedure (presumably Microsoft's) for such a process?
Thanks in advance.
modified on Monday, February 7, 2011 2:18 PM
|
|
|
|
|
There is no standard procedure for this. You could do it by hand, such as:
<br />
SqlDataReader dr = ...<br />
while(dr.Read())<br />
{<br />
MyObject obj = new MyObject();<br />
obj.Property1 = dr["Property1"];<br />
...<br />
}<br />
or use an Object Relational Mapping tool such Entity Framework, or create your own
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Dear all,
In my application i have first Datecontrol(using javascript) next followed by 2 dropdowns and finally uploader control from CuteWebUI.AjaxUploader.dll(its works like user control)
I am CuteWebUI.AjaxUploader.dll for uploader control which will show progress bar + time elapse while uploading a file it is showing postback
In IE it is working .(First i need to select date from Datecontrol followed by 2 dropdowns then need to select uploader button (like browse) and save finally)
But if the same page if i executed in Mozilla i am unable to open Datecontrol.But here i am facing one problem after selecting a file through uploader button showing postback then if i click datecontrol again now it is opening datecontrol.I am having doubt y datecontrol is not opening for first time.
Can any one help on these?Here is code for your reference.
uploadDocumentPopUp.aspx
------------------------
<%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="cc2" %>
<cc2:Uploader ID="Uploader1" runat="server" InsertText="Upload File (Max 10M)" OnFileUploaded="Uploader_FileUploaded">
<ValidateOption MaxSizeKB="10240" AllowedFileExtensions="jpg,jpeg,tiff,txt,doc,pdf,xls,rtf"/>
</cc2:Uploader>
uploadDocumentPopUp.aspx.cs
---------------------------
protected void Uploader_FileUploaded(object sender, UploaderEventArgs args)
{
Uploader uploader = (Uploader)sender;
fileName = args.FileName;
string fileNameWithOutExt = Path.GetFileNameWithoutExtension(fileName);
string fileExtension = Path.GetExtension(fileName);
fileNameWithOutExt += DateTime.Now + fileExtension;
fileNameWithOutExt = fileNameWithOutExt.Replace("/", "");
fileNameWithOutExt = fileNameWithOutExt.Replace(":", "");
fileNameWithOutExt = fileNameWithOutExt.Replace(" ", "");
ViewState["fileName"]=fileNameWithOutExt;
args.CopyTo(Server.MapPath(@"..\Documents\" + fileNameWithOutExt));
//alertMessage.Alert.Show("Document got uploaded please click upload button");
Response.Write("<script>alert('Document got uploaded successfully please click upload button!');</script>");
}
thanks in advance,
Subbu.
|
|
|
|
|
Hi,
I created a class library to do some logging and this class library need a configuraiton file to do some initialization work. I set the configuraiton file's build action to "Content".
Then I add reference to this class library from a asp.net application project. After build, the class lirary and the configuration file were put the output folder "bin".
As I begin to get the configuration files address in running, there are some errors occur because I ca't correctly locate the configuration file's address.
Please help: how could I get the configuration file's path?
thanks,
|
|
|
|
|
Hi!
You need to use the executing assembly's configuration file even for the library.
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn. What you don't know. We teach
|
|
|
|
|
Hi,
Where is the appropriate lifecycle step we can introduce JavaScript execution in the page? can anyone please explain?
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
Hi,
Friends i have a grid view with some coulmns like Name,Phone no etc with Edit,Delete column in grid view.
I click a row in grid view to Edit,it goes another page where i can edit all fields .Once i update i redirect the page to gridview.
I want the grid view to remain in that particular page say 4 of the grid view ie in which page i had edited the record.
Guhananth.S
|
|
|
|
|
Member 3222264 wrote: I click a row in grid view to Edit,it goes another page where i can edit all fields .Once i update i redirect the page to gridview.
Why do you do that? Its a very bad UI and not good usability wise.
Have a look at this article:Editable Nested GridView (All-in-One)[^]
This contains all the sample needed that can direct you...
|
|
|
|
|
Hi!
You should try to use a ModalPopupExtender from Ajax Toolkit to show the data that you want to edit.
This way your page will not change state and the view will remain as it was when you clicked on the row.
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn. What you don't know. We teach
|
|
|
|