|
bolly-81 wrote: it's not cool to work while having code lines hidden
Whats cool thn?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I have add check box in a gridview in eachh row at run time.I have a delete button on page.If it is clicked then all checkbox are checed if true yhen delete corresponding row.I have use Template column for checkbox.and bind an id with it.On running page this id is also visible but i want to do invisible it.also how can i retrieve this id if checkbox is checked.
here is code...
protected void Page_Load(object sender, EventArgs e)
{
query="select brok.*,cust.FirstName+' '+cust.LastName as Name from brokermsgrecieved as brok,custdetails as cust where brok.BrokerId='"+Session["broker"]+"' and cust.CustId=brok.FromCustId";
dt = obj.select(query);
GridView1.DataSource=dt;
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
CheckBox chk = new CheckBox();
e.Row.Cells[0].Controls.Add(chk);
if (e.Row.Cells[1].Text == "True")
{
e.Row.BackColor = Color.Wheat;
}
if (e.Row.Cells[1].Text == "False")
{
e.Row.BackColor = Color.WhiteSmoke;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
GridView1.DataSource = dt;
GridView1.DataBind();
Int16 count =(Int16) GridView1.Rows.Count;
for (Int16 i = 1; i < count; i++)
{
CheckBox chk = (CheckBox)GridView1.Rows[i].Cells[0].Controls[1];
if (chk.Checked.Equals(true))
{
//query="Delete from brokermsgrecieved where "
//GridView1.Rows[i].Cells[0].v
query = "delete from brokermsgrecieved where MsgId='1'";
obj.insert(query);
}
}
}
here is code such that i bind id----
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False"
="" width="611px" onrowdatabound="GridView1_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%# Eval("MsgID") %>
</ItemTemplate>
</asp:TemplateField>
|
|
|
|
|
use the HTML name attributre as place holder for other value.
<br />
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
CheckBox chk = new CheckBox();<br />
chk.Attributes.Add("name", e.Row.Cells[100].Text);
e.Row.Cells[0].Controls.Add(chk);<br />
<br />
}<br />
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
Int16 count = (Int16)GridView1.Rows.Count;<br />
for (Int16 i = 1; i < count; i++)<br />
{<br />
CheckBox chk = (CheckBox)GridView1.Rows[i].Cells[0].Controls[1];<br />
string id = CheckBox3.Attributes["name"];<br />
}<br />
}<br />
happy coding..
|
|
|
|
|
|
I have a class that inherits from CompositeControl that dynamically creates controls at runtime (typically 2-5 DropDownList controls). All of the control creation is happening in CreateChildControls().
When a page using that control first loads everything is correct. However, after the selected index is not being remembered. It doesn't matter what is selected in the DropDownList controls, SeletedItem or SelectedValue is always the first item in the control.
I then found some posting that said AutoPostBack needs to be set on the DropDownList Controls and that a check for IsPostBack needed to be put in CreateChildControls(). I did that but when a new item in any of the DropDownList controls was selected, all of the DropDownList controls were empty.
I then saw something that said for the ViewState to be preserved, the DropDownList control must first be added (i.e. Controls.Add()) and then load the control. That didn't help either.
Has anyone done anything like this before? Any guidance and how to get this thing to work?
Thanks!
|
|
|
|
|
i have dropdownlist1,dropdownlist2,textbox1,button1,button2,dropdownlist3
here i am selecting an item from each dropdownlist, perform concatinating and i showed in textbox fine.
but when i want to enlarge concatination means the selected item text will be overridden on the previous selecteditem text
i want to prevent this..
finally i want the TextBox2 output as follows;
exa:
(ddl1) (ddl2) (txt1) (btn1) (ddl) (ddl2) (txt1) (ddl3)
Month_no = 5 and Quarter_no = 3 group by(abc)
means
month_no = 5 and quater_no = 3 group by(abc)
how to get this one.........
help me out...
Regards,
Koti
|
|
|
|
|
You asked the similar question yesterday here[^]
katarukoti wrote: exa:
(ddl1) (ddl2) (txt1) (btn1) (ddl) (ddl2) (txt1) (ddl3)
What the %$%# is this???
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
The answer is correct somehow ie if i change any dropdownlist value it is override the corresponding value bec i wrote common funcatio like
textbox2.Text=ddl.selecteditem.text+ddl2.selecteditem.text+-----------
how to avoid overriding let me know......
Regards,
Koti.K
|
|
|
|
|
use the string format
Month_no = string.Format("{0} {1} {2} {3} {4} {5} {6} ({7})", (ddl1),(ddl2),(txt1) (btn1),(ddl),(ddl2),(txt1),(ddl3));
happy coding...
|
|
|
|
|
Hi
I have a trouble displaying Web Crystal Report from NT Current Event Log .
Using Crystal Reports 2008 I have created RPT file, with a data source NT Current Event Log, showing Security log from a network server from my LAN. The report is running fine from the designer, and also it runs fine from Visual Studio 2008 (C#) IDE
But if I try to deploy and run it from the web server, it fails.
I think that the user IUSR_MYServer that is running the web apps doesn't have right to open the remote EventLog, that's why I would like to supply another user/password on the connection
Is there any way to supply user name/password to the Crystal Reports web report, reporting from a remote server EventLog (Crystal Reports 2008)
Can I specify something similar to ADO connectionString (from code, dynamically), so I can specify the user/password
In my case I use VS 2008 (aspx 3.5, C#), CrystalReports 2008
Has somebody experienced this problem and what can be the solution?
regards,
Yakimo
|
|
|
|
|
i have created a shared assembly now how can i add reference and use this share assembly in the web application or vb application
|
|
|
|
|
Right click and add reference to it in your Visual Studio Project
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Got an error when i deployed not a valid virtual path. though i have added permissions to image folder on the server.
Iam using a function that returns save location and uploads the image. this is the code iam using:
Private Function Uploaded() As String
Dim filePath As String = AppSettings("~\Images")
Dim SaveLocation As String = String.Empty
If Not txtImgURL.Text.Length = 0 And Left(txtImgURL.Text, filePath.Length) <> filePath Then
Dim fileName As String = System.IO.Path.GetFileNameWithoutExtension(txtImgURL.Text).ToLower()
Dim fileExtention As String = System.IO.Path.GetExtension(txtImgURL.Text).ToLower()
SaveLocation = System.IO.Path.Combine(filePath, fileName & fileExtention)
Dim physicalLocation As String = Server.MapPath(SaveLocation)
If File.Exists(physicalLocation) = True Then
Dim sequencer As Integer = 1
SaveLocation = System.IO.Path.Combine(filePath, fileName & "_" & sequencer.ToString & fileExtention)
physicalLocation = Server.MapPath(SaveLocation)
Try
My.Computer.FileSystem.CopyFile(txtImgURL.Text, physicalLocation)
Catch
My.Computer.FileSystem.CopyFile(Server.MapPath(txtImgURL.Text), physicalLocation)
End Try
Else
Try
My.Computer.FileSystem.CopyFile(txtImgURL.Text, physicalLocation)
Catch
My.Computer.FileSystem.CopyFile(Server.MapPath(txtImgURL.Text), physicalLocation)
End Try
End If
End If
Return SaveLocation
End Function
Any help?
|
|
|
|
|
to which user you added the rights?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
i have added on folder images, the strange thing happening is that i can update an image already found but cant add a new image.
|
|
|
|
|
which user and which rigths are added to the directory?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
I have added to the directory aspnet user with full control and network service with full control.
|
|
|
|
|
that should be sufficient. The folder one level higher has both users with the rights? (back up to the root?)
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
is this folder somewhere within the wwwroot or have you placed outside wwwroot folder
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
I have tried both inside and outside but now it is inside
|
|
|
|
|
has wwwroot full control for asp_net user and network_Service ?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
|
well, that makes it a curious case.
I believe that if you pick Full Control you could still set some other options if you pick the Edit button.
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi Everyone,
Can anyone explain me about how the process takes place behind the restful webservice.
Ex: http://www.myservice.com/employee/1234
with this object how can we do all the [ADD,UPDATE] transactions. How does it differenciate, I am not clear on this.however for DELETE & Search we need only employee id.
Thanks in Advance.
Regards,
Manowj
|
|
|
|
|
Hello Friends,
I'm working on a Property site. In that site i've no. of cities like Delhi,Mumbai,Chennai and etc. and it will be around 15-20 cities
Now i've to display property accordingly the city. For it i've taken only one page which is dynamically brings the properties according cities name. But my question is is it okay to have a single page and bringing the data dynamically or should i take different different pages(15 pagges) according cities name. And also i've to make my site considering SEO(search engine optimization). So which way i should go through.
And also, how can i convert my .aspx page into html page for improving the speed
|
|
|
|