|
please help me with this code,I really don't understand what might be the problem
oga m
|
|
|
|
|
Count the parameters in the method signature, then in the code calling the method. When you have spotted that the number of paramteres doesn't match, check the parameters one by one until you spot the one that you have forgotten.
---
single minded; short sighted; long gone;
|
|
|
|
|
how to make download file?
|
|
|
|
|
just expose the url
<< >>
|
|
|
|
|
Hi dears,
I logged in to my webserver control panel and created a subdomain like "downloads".
then I created a directory in my wwwroot as same as subdomain "downloads" and put a default.aspx file in the directory. but when I type http://downloads.mysite.com in browser an error occured with this message:
Runtime Error <br />
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. <br />
<br />
Details: To enable the details of this specific error message to be viewable on remote machines, please create a < customErrors > tag within a "web.config" configuration file located in the root directory of the current web application. This < customErrors > tag should then have its "mode" attribute set to "Off".
Should I do anything more???
thx for your help,
www.behzadi.net
|
|
|
|
|
-first to see the error detail, set its mode to Off
- I just guess: you set webroot for the sub folder which you just created
<< >>
|
|
|
|
|
hi
how can rename a table in sql server 2000 (with tsql in query analyzer)?
|
|
|
|
|
RENAME TABLE old
TO new
hope this helps..
Kunal
|
|
|
|
|
from : http://p2p.wrox.com/topic.asp?TOPIC_ID=24417
Hi,
Yes, you can use sp_rename for renaming a table or column in SQL Server. The only difference is that if you want to rename a column witbin a table you need to provide proper namespace.
for e.g.
for renaming a table
EXEC sp_rename 'Old_TableName', 'New_TableName'
for renaming a column
EXEC sp_rename 'TableName.[Old_ColumnName]', 'TableName.[New_ColumnName]', 'COLUMN'
Hope this helps,
Lalit,
Life Means More...
|
|
|
|
|
Hi,
I have the following treeview, wich works perfect if I only have a depth of childnodes of one. But my problem is that my menu has a childnode depth of two.... Like this
Home
Products
--Dogs
----Food
----Brushes
--Cats
----Food
----Brushes
--Horses
Links
My code only expand (when I click on Products) and shows
Home
Products
--Dogs
--Cats
--Horses
Links
When I try to clik on Dogs - it does'nt expand the nex childnode (Food and Brushes)..... I tried to made a "Run to curser", and I can see, it does not go back to the server, and runs TreeNodePopulate. Can anyone help me? I want to expand also when I click on Dogs and so on.
My code:
aspx:
<asp:treeview id="MenuTree" enableclientscript="true" runat="server" maxdatabinddepth="2" expanddepth="2" showexpandcollapse="False" ontreenodecollapsed="MenuTree_TreeNodeCollapsed" ontreenodeexpanded="MenuTree_TreeNodeExpanded" ontreenodepopulate="MenuTree_TreeNodePopulate" populatenodesfromclient="true">
<hovernodestyle font-underline="True">
<selectednodestyle backcolor="Gray" font-underline="True">
aspx.cs:
public partial class Admin_SideAdm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ANSIApi api = new ANSIApi();
if (IsPostBack == false)
{
try
{
if (api.GetTopMenu(MenuTree) == ANSIApi.FStatus.Success)
{ }
}
catch
{ }
}
}
protected void MenuTree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
//hvis der ikke er nogen child nodes til noden
if (e.Node.ChildNodes.Count == 0)
{
try
{
api.GetSubMenu(e.Node);
}
catch
{ }
}
}
protected void MenuTree_TreeNodeCollapsed(object sender, TreeNodeEventArgs e)
{
try
{
int key_id = Convert.ToInt32(e.Node.Value);
lblMenuId.Text = key_id.ToString();
lblMenuId.Visible = true;
}
catch
{
}
}
protected void MenuTree_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
try
{
int key_id = Convert.ToInt32(e.Node.Value);
lblMenuId.Text = key_id.ToString();
lblMenuId.Visible = true;
if (e.Node.Depth == 0)
{
TreeView t = (TreeView)sender;
for (int i = 0; i < t.Nodes.Count; i++)
{
if (t.Nodes[i] != e.Node)
{
t.Nodes[i].CollapseAll();
}
}
}
}
catch
{
}
}
}
Kind regards,
simsen
|
|
|
|
|
hi
i wanted to implement sessions in my application... i wrote the following code on the login page
if (dread.Read())<br />
{<br />
Session["user"] = uname.Text;<br />
Response.Redirect("MainP.aspx");<br />
}
then on the page load event of the following pages i wrote this code..(used master pages.though)
<br />
if (!IsPostBack)<br />
{<br />
if (Session["user"] != null)<br />
{<br />
Label1.Text = Session["user"].ToString() + "!!";<br />
Response.Cache.SetExpires(DateTime.Now.AddSeconds(0));<br />
Response.Cache.SetCacheability(HttpCacheability.NoCache);<br />
Response.Cache.SetValidUntilExpires(true);<br />
<br />
}<br />
else<br />
{<br />
Response.Redirect("login.aspx");<br />
string uname = (string)(Session["User"]);<br />
}<br />
}
Now the problem is that, if i dont login, no page will open, if i type the URL, but afted logout, on BACK BUTTON press of the web browser, the page opens, instead of getting redirected to login page.
any ideas..
then i created a LOGOUT LInk Button, and wrote the following code...
protected void LinkButton1_Click(object sender, EventArgs e)<br />
{<br />
Session.Abandon();<br />
Session.Clear();<br />
Session["user"] = null;<br />
Response.Redirect("login.aspx");<br />
}
Kunal
|
|
|
|
|
Hi,
Put the following piece of code on every page, outside of postback check
if (Session["user"] == null){
Response.Redirect("login.aspx");
string uname = (string)(Session["User"]);
}
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
not working.. that back button still gets me to the page.. is there a problem with the logout link button code..??
Kunal
|
|
|
|
|
Kunal P wrote: Response.Cache.SetExpires(DateTime.Now.AddSeconds(0));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetValidUntilExpires(true);
Move the above code to the beginning of the Page_Load Event.
|
|
|
|
|
Hi guys
i want to create a asp.net application which can listen to incoming TCP/IP packets. It should be able to send commands to a remote IP system and get reply from there. The remote system can be a hand held device.
Can anyone help me to get and manage IP packets . I am using c# and asp.net
Regards
Hari
|
|
|
|
|
Hello guys/gals:
Background:
I have a C# desktop application that uses SOAP to pull information from a web service located somewhere on the LAN. The need has arisen, for my application to also be able to send data back to the service, meaning that the request is initiated at the server end.
So after some initial research, it seems as though I need to create a web service on my end that listens for such requests. However, I'm still a bit confused on whether this is the route to take. So I was hoping on getting some help from fellow developers with web services experience:
Questions:
1) Is it even necessary for me to create a web-service, or is there a way that my application can still remain a client and still be able to respond to requests initiated by the server on the other end via SOAP?
2) If I do have to create a web service on my end, is there a way to control that web-service from within my C# application? (e.g. starting/stopping the service, access to its data members and methods)? Basically the following:
*My Web Service Receives Request -->My Desktop App is aware of that request and gathers the data<br />
<br />
*My Desktop app passes the data to the web service-->My Web Service Replies<br />
Sorry for the long post, and thanks for your help!
-- modified at 20:35 Saturday 7th April, 2007
|
|
|
|
|
Hello.
am trying to set a value from aspx.cs page (string str) and then want to access that value in the aspx page.
Please let me know how to do that.
|
|
|
|
|
Hi,
- Declare your variable as public in the aspx.cs
- in your .Aspx use : <%=myVar%> in any place
HTH
Hayder Marzouk
|
|
|
|
|
Hi all,
I use DetailsView Object in ASP.NET.
It dosen’t appear until the refresh button in IE clicks.
I set the DataSource Property and use the DataBind Method.
What i can do?
|
|
|
|
|
would you like to post your code with the event you are using to perform tis task?
|
|
|
|
|
Hi
This is my code
asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Height="40px"Style="direction: rtl" Width="472px"
Fields
asp:BoundField DataField="Employer" HeaderText="کارفرما"
asp:BoundField DataField="Advisor" HeaderText="مشاور"
asp:BoundField DataField="StartTime" HeaderText="زمان شروع"
asp:BoundField DataField="EndTime" HeaderText="پیش بینی تاریخ اتمام پروژه"
asp:BoundField DataField="TimeAgreement" HeaderText="مدت قرارداد به ماه"
asp:BoundField DataField="State" HeaderText="محل اجرا"
Fields
asp:DetailsView>
asp:SqlDataSource ID="SQLDS_ALLV_TitleIE" runat="server" ConnectionString="<%$ ConnectionStrings:SamanMohitConnectionString %>"
SelectCommand="ALLV_TitleIE" SelectCommandType="StoredProcedure"
SelectParameters
asp:ControlParameter ControlID="Label1" Name="F_Title" PropertyName="Text" Type="String"
asp:Parameter DefaultValue="فارسی" Name="F_Language" Type="String"
SelectParameters
asp:SqlDataSource
I use the "<"and "/>" in my code
And this is runtime code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (Application("SN") = "Agreement") Then
Label1.Text = PreviousPage.mText1.Text
DetailsView1.DataSource = SQLDS_ALLV_TitleIE
DetailsView1.DataBind()
ElseIf (Application("SN") = "News") Then
Label3.Text = PreviousPage.mText1.Text
DetailsView2.DataSource = SQLDS_NL_Title
DetailsView2.DataBind()
End If
LinkButton1.CommandName = Application("Search")
End Sub
-- modified at 0:48 Sunday 8th April, 2007
|
|
|
|
|
سلام
اگر فارسی می نویسیم به این دلیل است که از نوع عناوین جنابعالی فهمیدم که ایرانی هستید.
به هر حال برای Bind کردن DetailsView با این روشی که شما انتخاب کرده اید و از SqlDataSource استفاده می کنید، برای گرفتن نتیجه باید از DetailsView1.DataSourceId استفاده کنید درضمن هنگام تعریف DetailsView میتوانید در کد های HTML نیز این مشخصه را تعیین نمایید برای مثال:
asp:DetailsView ID="dtl1" DataSourceId="SQLDS_ALLV_TitleIE" runat="server" ..... /asp:DetailsView
در ضمن بهتر است دستور Select شما حاوی شرطی باشد که موجب برگرداندن یک رکورد شود.
اگر هم با SqlDataSource مشکل دارید می توانید از DataTable استفاده کنید.
البته با عرض معضرت باید بگویم که روشی که شما انتخاب کرده اید با مراجعات متعدد به سایت رفته رفته از سرعت آن کاسته خواهد شد یعنی خاصیت SqlDataSource چنین است که در هر بار PageLoad اجرا شود در حالی که شما فقط به یکی از SqlDataSource ها نیاز دارید ولی در هر بار هر دوی انها اجرا خواهد شد که این روش خوبی نیست.
به هر حال اگر به نتیجه نرسیدید اگر کمکی از دست من بربیاید یا در همین سایت و یا به آدرس abolfazl585@yahoo.com میل بزنید.
باتشکر
We Can Do Anything, If We Want It
|
|
|
|
|
Hi all,
I use Application object in ASP.NET.
I set it’s value in one page and read it in another page but I don’t know when I can dispose this object in order to in the first page it’s not set and if an event accord it set again.
Thanks in advance
|
|
|
|
|
You should only use the application object for things you want to keep across user sessions. Like some sort of static data that all users would be looking at. It sounds like you should be using a session variable to pass things from one page to the next. Session is very similar to the application object except it is only for that user, other users can see that object, they can only see their own session object.
Either way if you want to remove and object from the session or application you can just set it to null or Nothing in vb.net. There is also a Remove method in the object to remove something from the application or session object.
Hope that helps.
Ben
|
|
|
|
|
When i can use it?(What event)
|
|
|
|